The result is the return value of the 'unique' expression. If you run from a file you could either put the whole thing in a "println" statement:
Code: Select all
(println (unique (sort
(find-all {[a-zA-Z]+}
(replace "<[^>]+>" (get-url "http://newlisp.org") "" 0) )
)))
(exit)
or you could do an assignment, then print it:
Code: Select all
(set 'result (unique (sort
(find-all {[a-zA-Z]+}
(replace "<[^>]+>" (get-url "http://newlisp.org") "" 0) )
)))
(println result)
(exit)
On the latest development versions (currently 10.2.16) you can also paste multi line statements into the interactive newLISP shell:
Code: Select all
~> newlisp <---- start newLISP in a command shell
newLISP v.10.2.16 on OSX IPv4/6 UTF-8, execute 'newlisp -h' for more info.
> <---- hit enter on an empty line at the prompt, then copy paste the code
(unique (sort
(find-all {[a-zA-Z]+}
(replace "<[^>]+>" (get-url "http://newlisp.org") "" 0) )
))
<---- hit enter again on an empty line to see the result
("API" "About" "All" "Apps" "Art" "Built" "C" "Cilk" "Development" "Docs" "Documented"
"Downloads" "Expandable" "Find" "Forum" "FriendFeed" "Friendly" "GNU" "GPL" "GS"
…
…
"using" "v" "verdana" "version" "weight" "when" "width" "wiki" "will" "with" "work"
"written" "you")
> <---- after printing, you get your prompt back
when you hit the [enter] key at the prompt, the prompt disappears and you can enter or paste multi line statements. A second [enter] on an empy line gets you out and evaluates the expression.
NOTE, all this has to be in an interactive shell (e.g. Command shell in Windows, or terminal shell in UNIX) of the operating system. This will not work in the lower window of the newLISP-GS IDE.