Hello, World! in J
Example for versions
j602
1!:2 is the dyadic foreign conjunction for writing text, the left argument is the string to be written and the right argument specifies the file number, a file number 2 indicates that the text is to be written to the screen.
Alternatively we can use currying to convert the dyadic write conjunction into a monadic conjunction using the bond (&) operator and assign it to a named print function.
The printf library may also be used to print text to the screen.
'Hello, World!' 1!:2]2
print=: 1!:2&2
print 'Hello, World!'
load 'printf'
'' printf 'Hello, World!\n'
Comments
]]>blog comments powered by Disqus
]]>