Search found 6 matches

by mark5009
Fri Mar 03, 2017 4:35 am
Forum: newLISP in the real world
Topic: conditional compilation?
Replies: 0
Views: 1993

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...
by mark5009
Wed Dec 10, 2014 11:25 pm
Forum: newLISP in the real world
Topic: Simple template for cmd-line scripts
Replies: 0
Views: 1787

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. ...
by mark5009
Fri Nov 28, 2014 2:04 am
Forum: newLISP in the real world
Topic: newlisp main-args not to execute
Replies: 4
Views: 2324

Re: newlisp main-args not to execute

I generally just use the #! syntax

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")
Hope this helps.

.. m.
by mark5009
Sun Oct 26, 2014 11:09 pm
Forum: newLISP in the real world
Topic: (newbie) Listiness
Replies: 6
Views: 2274

Re: (newbie) Listiness

Thanks, guys! That is most helpful.

.. mark.
by mark5009
Sun Oct 26, 2014 1:57 am
Forum: newLISP in the real world
Topic: (newbie) Listiness
Replies: 6
Views: 2274

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...
by mark5009
Sat Oct 25, 2014 6:40 am
Forum: newLISP in the real world
Topic: (newbie) Listiness
Replies: 6
Views: 2274

(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...