Language S3
(An algol-based system language)
Date: | 08/24/05 |
Author: | Steve Hammond |
URL: | n/a |
Comments: | 5 |
Info: | n/a |
Score: | ![]() |
MODULE BOTTLES EXT (<PREFIX "ICLCTM">) PROC ( REF () BYTE , RESPONSE ) SEND_MESSAGE ; GLOBAL STATIC (<STATUS 5>) PROC BOTTLES IS () : BEGIN INT I_RESPONSE ; INT I_COUNT := 99 ; () BYTE S_OUTPUT := "** bottles of beer on the wall" X"15" "** bottles of beer" ; REF () BYTE PART1 IS S_OUTPUT (0 SIZE 2) ; REF () BYTE PART2 IS S_OUTPUT (31 SIZE 2) ; FOR I_COUNT FROM 99 TO 0 BY -1 DO UNPACKS ( S'D'I_COUNT , PART1 , 0 , NIL ) ; MOVE ( PART1 , PART2 , 0 , 0 , NIL , NIL ) ; SEND_MESSAGE ( S_OUTPUT , I_RESPONSE ) REPEAT END ; ENDMODULE
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
The ability to define structures (Modes) which can not only be viewed / written differently (Any) including references (Ref) (ie 'pointers' to structures) and that the structures can also contain variables which are actually procedure variables (GProc) makes the language incredibly powerful.
The language thus lends itself readily... to tree navigation... and to fully structured programming where each module, including the data and procedure calls can be completely isolated from all other data / procedures!
Maybe its me but S3 was the first language that I wrote.... and despite writing all sorts of other stuff... from 8086 assembler to VB and C ++ still remains by far the best!
'Take one down and pass it around, 98 bottles of beer on the wall.'
but this would be easily remedied by adding an extra declaration and then inserting I_Count -1 as appropriate.
Hey... and I thought that I'd forgotten everything that I'd ever learned about code inspections!