Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
6
Task/Rendezvous/PicoLisp/rendezvous-1.l
Normal file
6
Task/Rendezvous/PicoLisp/rendezvous-1.l
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
(de rendezvous (Pid . Exe)
|
||||
(when
|
||||
(catch '(NIL)
|
||||
(tell Pid 'setq 'Rendezvous (lit (eval Exe)))
|
||||
NIL )
|
||||
(tell Pid 'quit @) ) ) # Raise caught error in caller
|
||||
56
Task/Rendezvous/PicoLisp/rendezvous-2.l
Normal file
56
Task/Rendezvous/PicoLisp/rendezvous-2.l
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
(de printLine (Str)
|
||||
(cond
|
||||
((gt0 *Ink) (prinl *ID ": " Str) (dec '*Ink))
|
||||
(*Backup (rendezvousPrint @ Str) T)
|
||||
(T (quit "Out of Ink")) ) )
|
||||
|
||||
(de rendezvousPrint (Printer Str)
|
||||
(let Rendezvous NIL
|
||||
(tell Printer 'rendezvous *Pid 'printLine Str) # Call entry point
|
||||
(unless (wait 6000 Rendezvous) # Block max. 1 minute
|
||||
(quit "Rendezvous timed out") ) ) )
|
||||
|
||||
# Start RESERVE printer process
|
||||
(unless (setq *ReservePrinter (fork))
|
||||
(setq *ID 2 *Ink 5)
|
||||
(wait) ) # Run forever
|
||||
|
||||
# Start MAIN printer process
|
||||
(unless (setq *MainPrinter (fork))
|
||||
(setq *ID 1 *Ink 5 *Backup *ReservePrinter)
|
||||
(wait) )
|
||||
|
||||
# Start Humpty Dumpty process
|
||||
(unless (fork)
|
||||
(when
|
||||
(catch '(NIL)
|
||||
(for Line
|
||||
(quote
|
||||
"Humpty Dumpty sat on a wall."
|
||||
"Humpty Dumpty had a great fall."
|
||||
"All the king's horses and all the king's men"
|
||||
"Couldn't put Humpty together again." )
|
||||
(rendezvousPrint *MainPrinter Line) ) )
|
||||
(prinl " Humpty Dumpty: " @ "!") )
|
||||
(bye) )
|
||||
|
||||
# Start Mother Goose process
|
||||
(unless (fork)
|
||||
(when
|
||||
(catch '(NIL)
|
||||
(for Line
|
||||
(quote
|
||||
"Old Mother Goose"
|
||||
"When she wanted to wander,"
|
||||
"Would ride through the air"
|
||||
"On a very fine gander."
|
||||
"Jack's mother came in,"
|
||||
"And caught the goose soon,"
|
||||
"And mounting its back,"
|
||||
"Flew up to the moon." )
|
||||
(rendezvousPrint *MainPrinter Line) ) )
|
||||
(prinl " Mother Goose: " @ "!") )
|
||||
(bye) )
|
||||
|
||||
# Prepare to terminate all processes upon exit
|
||||
(push '*Bye '(tell 'bye))
|
||||
Loading…
Add table
Add a link
Reference in a new issue