RosettaCodeData/Task/Hostname/J/hostname.j

14 lines
364 B
Text
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
NB. Load the socket libraries
load 'socket'
coinsert 'jsocket'
NB. fetch and implicitly display the hostname
> {: sdgethostname ''
NB. If fetching the hostname is the only reason for loading the socket libraries,
NB. and the hostname is fetched only once, then use a 'one-liner' to accomplish it:
> {: sdgethostname coinsert 'jsocket' [ load 'socket'