From 73b3078cb551f03d959e8beb1adc6804efb13579 Mon Sep 17 00:00:00 2001 From: glenda Date: Wed, 5 Oct 2022 13:29:07 +0000 Subject: Update demos and remote.apl --- demos/demo | 3 ++- demos/rdemo | 2 +- runtime/remote.apl | 12 ++++-------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/demos/demo b/demos/demo index 3266fa5..d128b17 100755 --- a/demos/demo +++ b/demos/demo @@ -1,4 +1,5 @@ #!/bin/rc -font=/lib/font/bit/APL386/22/font +font=/lib/font/bit/APL386/28/font acme -c1 -f$font -F$font demos +kill apl | rc diff --git a/demos/rdemo b/demos/rdemo index cc96767..73a311d 100755 --- a/demos/rdemo +++ b/demos/rdemo @@ -1,5 +1,5 @@ #!/bin/rc -font=/lib/font/bit/APL386/22/font +font=/lib/font/bit/APL386/28/font rm -f /srv/apl rio diff --git a/runtime/remote.apl b/runtime/remote.apl index f696a15..7733783 100644 --- a/runtime/remote.apl +++ b/runtime/remote.apl @@ -1,11 +1,9 @@ REMOTE←{ fd←⎕PIPE ⍵ - out←{ - msg←{1(2⊃⍵)}⍇⍬ - raw←0 ⎕SERIAL msg + output←{ + raw←0 ⎕SERIAL ⍵ len←(4⍴255)⊤≢raw _←fd ⎕WRITE len,raw - ∇⍵ } in←{ m←1 ⎕serial fd ⎕read (4⍴255)⊥fd ⎕read 4 @@ -13,13 +11,11 @@ REMOTE←{ ∇⍵ } remote←{ - 0≡≢⍵: ⍺∇out&'remote out'⊢⎕self ⍝ Spawn out thread - 1≡≢⍵: ⍺∇⍵,in&'remote in'⊢⎕self ⍝ Spawn in thread - (outid inid)←⍵ + ⍬≡⍵: ⍺∇in&'remote in'⊢⎕self ⍝ Spawn 'in' thread master←⍺ (from msg)←{1 ⍵}⍇⍬ _←{ - from≡master: msg⍈outid + from≡master: output msg from≢master: msg⍈master }⍬ ⍺∇⍵ -- cgit v1.2.3