APL
APL is an interesting language in that a simple hello world
program can be done thus:
'HELLO WORLD'
will cause the typed text within quotes to appear on the
terminal. No variables are needed, or print statements. Of
course, if you want/need to store it, then:
a<-'HELLO WORLD'
a
Typing 'a' causes a's value to be printed.
APL is generally a loopless language. In general, loops like
those in other HLLs such as Fortran or C (especially those
whose purpose are to step through each item of a list, vector,
array, etc.) aren't needed.
So, if we wanted 100 copies of 'hello world' we'd just do:
hello<-100 11 P a
hello
The P (reshape) operator takes a's value and makes a 100x11 array
of it, and stores it in hello. Typing 'hello' just prints the
value -- 100 copies of 'hello world'!
Of course, if you want infinite loops, then that technique won't
work (you don't have infinite storage do you?) then do:
1: 'hello world'
2: ->1
-> is a 'goto'.
The '100 P a' type stuff is not real APL, inasmuch as APL uses special characters,
and P is the closest I can get to the APL (rho) operator (greek rho) in Ascii.
submitted by: dfox@belvdere.vip.best.com (David Fox)