Language RPL/2
(With recursion and multithreading)
Date: | 08/13/06 |
Author: | JKB |
URL: | http://www.systella.fr/~bertrand |
Comments: | 0 |
Info: | n/a |
Score: | (2.87 in 8 votes) |
#!/usr/local/bin/rpl -sc /* * With multithread and recursive function. * RPL/2 4.00pre8p is required. * (C) JKB, 12th of august 2006. */ BOTTLES << // Child process is started. 100 'RECURSIVE' detach -> PROC << do PROC recv until end drop2 do // Parent waits for datas sent by child. do PROC recv until end list-> drop dup " on the wall," + disp "." + disp "Take one down, pass it around," disp if dup 1 same not then do PROC recv until end list-> drop else 1 "No more bottles of beer" end " on the wall." + disp drop "" disp until 1 same end // Parent waits for Child's death. PROC wfproc >> >> RECURSIVE << while dup repeat 1 - dup dup ->str if over 1 > then " bottles " else " bottle " end + "of beer" + 2 ->list dup // Child send datas to parent process. send send // Recursive function is caught. RECURSIVE end >>
Download Source | Write Comment
Download Source | Write Comment
Add Comment
Please provide a value for the fields Name,
Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.
Please don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments