Suggested fileIn code for repl.slate

John Leuner jewel at pixie.co.za
Wed Jul 28 08:12:26 PDT 2004


Could you add a fileIn method to repl.slate (as below or something
similar)?

Index: bootstrap/mobius/repl.slate
===================================================================
RCS file: /var/lib/cvs/slate/slate/bootstrap/mobius/repl.slate,v
retrieving revision 1.8
diff -u -r1.8 repl.slate
--- bootstrap/mobius/repl.slate 23 Jul 2004 05:14:42 -0000      1.8
+++ bootstrap/mobius/repl.slate 28 Jul 2004 15:34:17 -0000
@@ -5,6 +5,15 @@
 REPL addSlot: #lineCount valued: 0.
 REPL addSlot: #basePrompt valued: '> '.
 
+s@(String traits) fileIn
+[ | input aparser interp p|
+" Console ; 'Filing in $'' ; s ; '$'.$\n'."
+ input: (File open: s).
+ aparser: ((Syntax Parser clone) newOn: (input reader)).
+ [ aparser atEnd ] whileFalse: [ p: aparser next. (lobby interpretHook:
[ p evaluateIn: lobby ])].
+ input close.
+].
+

-- 
John Leuner <jewel at pixie.co.za>




More information about the Slate mailing list