Search found 6 matches
- Fri Mar 03, 2017 4:35 am
- Forum: newLISP in the real world
- Topic: conditional compilation?
- Replies: 0
- Views: 5137
conditional compilation?
Hi. Running under OSX/Unix, I like to first test my code with a #! , then compile them with a -x for use. So, $ cat foo.lsp #! /usr/bin/env newlisp (println "args -> " (main-args)) (exit) $ ./foo.lsp bob args -> ("newlisp" "./foo.lsp" "bob") $ newlisp -x foo.lsp foo $ ./foo bob args -> ("./foo" "bob...
- Wed Dec 10, 2014 11:25 pm
- Forum: newLISP in the real world
- Topic: Simple template for cmd-line scripts
- Replies: 0
- Views: 3251
Simple template for cmd-line scripts
I have been enjoying using NL in what I do. Part of that is to create lots of little scripts to do simple tasks (calculate this, work out that) under various unix platforms (incl OSX). Nothing sophisticated, just useful. So, to help fellow newbies along I thought I'd share the basic template I use. ...
- Fri Nov 28, 2014 2:04 am
- Forum: newLISP in the real world
- Topic: newlisp main-args not to execute
- Replies: 4
- Views: 4450
Re: newlisp main-args not to execute
I generally just use the #! syntax
Hope this helps.
.. m.
Code: Select all
$ cat foo.lsp
#!/usr/bin/newlisp
(println (main-args))
(exit)
$ chmod 755 foo.lsp # make sure foo.lsp is executable
$ ./foo.lsp xxxx.file
("/usr/bin/newlisp" "./foo.lsp" "xxxx.file")
.. m.
- Sun Oct 26, 2014 11:09 pm
- Forum: newLISP in the real world
- Topic: (newbie) Listiness
- Replies: 6
- Views: 5186
Re: (newbie) Listiness
Thanks, guys! That is most helpful.
.. mark.
.. mark.
- Sun Oct 26, 2014 1:57 am
- Forum: newLISP in the real world
- Topic: (newbie) Listiness
- Replies: 6
- Views: 5186
Re: (newbie) Listiness
Thanks for your reply, bairui. My problem is I am not being very clear. Here is the real issue. Say I have a file I want to read: # stuff to ignore 123:avc 234:vvc # more to ignore and the following blank line as well # and there is the last stuff 999:xxc I want to end up with something like: > (set...
- Sat Oct 25, 2014 6:40 am
- Forum: newLISP in the real world
- Topic: (newbie) Listiness
- Replies: 6
- Views: 5186
(newbie) Listiness
Hi. Newbie here. I am trying to understand what is happening here. My expectation is that bar should contain (() 1 2 3 4 5) (which is what I am after, but it doesn't. Can someone fill me in on where my thinking is a little broken? I want to construct a list of the individual items of foo in bar. Tha...