[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with a small program
> I was trying a small program from the paper
> "Es: A shell with higher-order functions" - Haahr and Rakitzis
>
> on my system "dgux asterix 5.4R3.10 generic AViiON" (asterix is my system's
> pet name). The program is as follows ..
>
> ;fn hello-world {
> return 'hello, world'
> }
> ;echo <>{hello-world}
> ... At this point instead of getting the result as "hello, world", i get the
> following error
> "bad /dev/fd redirection"
That's something which changed after the paper was published. The <>
syntax was replaced with <=. <> now means open for reading and writing.
Using the new syntax, it works:
; fn hello-world {
return 'hello, world'
}
; echo <= { hello-world }
hello, world
; echo <= hello-world
hello, world
;
See http://www.webcom.com/haahr/es/es-usenix-winter93.html#erratum2.
> another question i have, is --
>
> how to execute es programs from a file??
> i typed in above function and the following echo statement in a file,
> changed it's permissions to "a+x". But when i typed the name of this
> file on es prompt, it gave me "Bad Exec format error".
Try putting
#! /usr/local/bin/es
(or whatever the right path is) as the first line of your file.
--p