Search found 115 matches
- Sun Aug 26, 2007 5:14 pm
- Forum: Anything else we might add?
- Topic: p73 Introduction to newLISP
- Replies: 2
- Views: 2064
p73 Introduction to newLISP
p73's topic is "6 Apply and map: applying functions to lists" In part it says: Since we're holding the data in a symbol called data, we could try this: (add data) value expected in function add : data but no, this doesn't work, because add wants numbers to add, and neither does this: (add data) valu...
- Mon Aug 20, 2007 4:03 am
- Forum: Anything else we might add?
- Topic: CGI module available?
- Replies: 2
- Views: 2041
Look into your modules directory either c:\Program Files\newlisp\modules or /usr/share/newlisp/modules (what OS are you using?) you can find documentation here: http://newlisp.org/code/modules/ you can create the same documentation on your machine running newlispdoc inside the modules directory: ne...
- Sun Aug 19, 2007 12:57 pm
- Forum: Anything else we might add?
- Topic: CGI module available?
- Replies: 2
- Views: 2041
CGI module available?
I'd like to use newLISP to write CGI apps with SQL database backends.
Is there a newLISP library that deals exclusively with CGI support -- something like CGI.pm or its predecessor cgilib.pl?
I'll have to write one if such doesn't yet exist. TIA...
Is there a newLISP library that deals exclusively with CGI support -- something like CGI.pm or its predecessor cgilib.pl?
I'll have to write one if such doesn't yet exist. TIA...
- Fri Aug 17, 2007 6:34 pm
- Forum: Anything else we might add?
- Topic: illegal parameter type in function set : 1
- Replies: 5
- Views: 2868
oops - yes there were some apostrophe problems and I see that I hadn't caught all of them... Also - you seem to be going through this very carefully, and I'm not sure that it's been that thoroughly 'road-tested' before (It's notoriously difficult for a writer to test their own work as comprehensive...
- Fri Aug 17, 2007 6:30 pm
- Forum: Anything else we might add?
- Topic: illegal parameter type in function set : 1
- Replies: 5
- Views: 2868
You need to quote the list you are assigning to 'data. The interpreter always assumes the first atom in a list is a function to be applied to the rest of the elements in the list unless the list is quoted: (set 'data (1 2 3)) ; => tries to set data to the value of applying function 1 to values 2 an...
- Fri Aug 17, 2007 5:11 pm
- Forum: Anything else we might add?
- Topic: illegal parameter type in function set : 1
- Replies: 5
- Views: 2868
illegal parameter type in function set : 1
Hi...
I cannot get the following example to work:
(set 'data (1 1 2 2 2 2 2 2 2 3 2 4 4 4 4) )
(unique data)
(println data)
I keep on getting the subject error -- yet the example is out of "Introduction to newLISP" - except for the (println .. ) line.
What am I missing? TIA...
I cannot get the following example to work:
(set 'data (1 1 2 2 2 2 2 2 2 3 2 4 4 4 4) )
(unique data)
(println data)
I keep on getting the subject error -- yet the example is out of "Introduction to newLISP" - except for the (println .. ) line.
What am I missing? TIA...
- Thu Aug 16, 2007 5:57 am
- Forum: Anything else we might add?
- Topic: catch and throw functions
- Replies: 3
- Views: 2307
Because "i was 5" is the value of the catch. It was not caught into any symbol, so there was no output. If you run it inside the repl, the entire expression will evaluate to "i was 5", but only the print statement will print things out. Here is a more comprehensive tutorial I wrote on newLisp error...
- Wed Aug 15, 2007 4:00 am
- Forum: Anything else we might add?
- Topic: catch and throw functions
- Replies: 3
- Views: 2307
catch and throw functions
Hey...
on p19 of "Introduction-to-newLISP" the following example is given:
(catch
(for (i 0 9)
(if (= i 5) (throw (string "i was " i)) )
(print i " ")
)
)
For some reason, the above does not print "i was 5", yet it does print the correct output. What am I missing? TIA...
--
dukester
on p19 of "Introduction-to-newLISP" the following example is given:
(catch
(for (i 0 9)
(if (= i 5) (throw (string "i was " i)) )
(print i " ")
)
)
For some reason, the above does not print "i was 5", yet it does print the correct output. What am I missing? TIA...
--
dukester
- Fri Jul 27, 2007 1:56 pm
- Forum: Anything else we might add?
- Topic: REPL behavior
- Replies: 10
- Views: 5471
When visually parsing a lisp list, evaluate from the inside out. After learning to do this, lisp's syntax will become so much easier to visualize than imperative programming, because with lisp you are, basically, writing the actual internal structure of the program, rather than a more declarative s...
- Fri Jul 27, 2007 1:53 pm
- Forum: Anything else we might add?
- Topic: REPL behavior
- Replies: 10
- Views: 5471
Let's see if I'm getting this: (upper-case (println "hello world")) is a list of 2 functions and some data... correct? 1st-- println function does its thing and displays the data 2nd-- upper-case function does _its_ thing on the data 3rd-- REPL displays the last item in the list Am I close? Yes! :-...
- Fri Jul 27, 2007 1:57 am
- Forum: Anything else we might add?
- Topic: REPL behavior
- Replies: 10
- Views: 5471
That's exactly right. Anything printed will have the additional side effect of printing the value of the expression entered. READ-EVAL-PRINT-LOOP means that the expression is read, evaluated, the value is printed, and then then started over. Printing a statement returns the text printed, so (printl...
- Thu Jul 26, 2007 1:09 am
- Forum: Anything else we might add?
- Topic: REPL behavior
- Replies: 10
- Views: 5471
REPL behavior
i'm new to newlisp! Currently reading "newlisp in 21 minutes" as an intro.
(println "Hello World!")
prints twice at the newlisp console because:
REPL prints it once
println prints it a second time
Is this a correct interpretation of whats going on? TIA...
--
dukester
(println "Hello World!")
prints twice at the newlisp console because:
REPL prints it once
println prints it a second time
Is this a correct interpretation of whats going on? TIA...
--
dukester
- Thu May 10, 2007 1:33 pm
- Forum: newLISP in the real world
- Topic: Is there an ideal programming cycle for newLISP?
- Replies: 8
- Views: 5199
late but.... I usually edit in an editor (TextWrangler at present) and hit the 'run' command. It works fine. Recently, trying to track So this 'run' command must be equivalent to other editors' tools option which allow you to set up a compiler/interpreter to execute the code? down some error of min...
- Wed May 09, 2007 3:31 am
- Forum: newLISP in the real world
- Topic: Is there an ideal programming cycle for newLISP?
- Replies: 8
- Views: 5199
At the end of this page: http://www.turtle.dds.nl/newlisp/index.html you find a nice screenshot of running a shell inside a split window in Vim. Lutz I use Vim a lot when I'm on my FreeBSD box. So you edit the source code with Vim. You run the code from another xterm window? Or from within Vim itse...
- Tue May 08, 2007 5:29 pm
- Forum: newLISP in the real world
- Topic: Is there an ideal programming cycle for newLISP?
- Replies: 8
- Views: 5199
Is there an ideal programming cycle for newLISP?
Hey all..... I'm new to newLISP! I'm wondering if there's an ideal way to program in newLISP? With some other languages that I've used, I typically have to windows open: 1. vim editor 2. compiler I edit my source code in one window; ALT TAB to the next window; UP ARROW for the latest CLI command (i....