diff options
author | glenda <glenda@cirno> | 2022-09-10 17:14:51 +0000 |
---|---|---|
committer | glenda <glenda@cirno> | 2022-09-10 17:14:51 +0000 |
commit | a1a9641baeab04b954420122b6fd1c9428a757b5 (patch) | |
tree | 1d41db19a169d3d6d130841750968ccb3e974a85 /runtime/start.apl | |
parent | e2ebfbb7d19ff3b990eb51dc9843200053cbbf98 (diff) |
Try some more
Diffstat (limited to 'runtime/start.apl')
-rw-r--r-- | runtime/start.apl | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/runtime/start.apl b/runtime/start.apl index c98462e..70df0fb 100644 --- a/runtime/start.apl +++ b/runtime/start.apl @@ -1,8 +1,19 @@ ⎕session←{ (indented main prompt)←⍵ + ⎕rawio←'Welcome to APL9',(⎕ucs 10),prompt + indented←≢prompt + unindent←{ ⎕rawio←⎕ucs ⍺⍴8 } + handleMain←{ + 0::⍺ + data←⍵ + ⎕rawio←data + ⎕rawio←⎕ucs 10 + ⎕rawio←prompt + ≢prompt + } handleError←{ 0::⍺ (task (error msg taskname))←⍵ @@ -31,11 +42,12 @@ (task (type data))←⍵ indented←⍺ _←indented∘unindent IF (indented>0)∧task≢main - type≡'!': 0 handleError task data - type≡'⎕': 0 handleQuad data - type≡'⍞': 0 handleQuoteQuad data + indented←indented×task≡main + type≡'→': indented handleMain data + type≡'!': indented handleError task data + type≡'⎕': indented handleQuad data + type≡'⍞': indented handleQuoteQuad data ⍵ } {∇ ⍵ handle {1 ⍵}⍇⍬} indented -}&'session'⊢0 ⎕self (6⍴' ') -⎕←'Welcome to APL9' +}&'session'⊢0 ⎕self ('APL9> ') |