[e-lang] simple question

Matej Kosik kosik at fiit.stuba.sk
Wed Aug 16 14:24:35 EDT 2006


Information about "safe-scope" is intersting. Some things work.

Kevin Reid wrote:
> 
> Of course they can.
> 
>    ? def makeEParser := <import:org.erights.e.elang.syntax.makeEParser>
> 
>    ? def program := makeEParser.run(<file:///home/kosik/program.e>)

# in my version it has to be
def program := makeEParser.run(<file:///home/kosik/program.e>.getText())

>    # value: e`...`
> 
>    ? def object := program.eval(safeScope)
>    # value: <programWithoutAuthority>
> 
>    ? var alive := true
>    ? def writer(text) {
>    >   require(alive)
>    >   alive := false
>    >   def lines := text.split("\n")
>    >   <file:///home/kosik/output.txt>.appendText(
>    >     "\n".join(lines(0, 10.min(lines.size())))
>    >   )
>    > }
> 
>    ? object.run(writer)

Thank you. I think I understand. Working examples are attached. (Just
for the archives).

The last line of 18.e defines the result value of the

	program.eval(safeScope)

statement. Similar source-code (mine is dull) could be perhaps demoed on
your web-pages.
-- 
Matej Kosik
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 18.e
Url: http://www.eros-os.org/pipermail/e-lang/attachments/20060816/159da867/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 19.e
Url: http://www.eros-os.org/pipermail/e-lang/attachments/20060816/159da867/attachment-0001.pl 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://www.eros-os.org/pipermail/e-lang/attachments/20060816/159da867/attachment.bin 


More information about the e-lang mailing list