Search found 14 matches

by scratchy
Fri Sep 03, 2004 3:17 pm
Forum: Anything else we might add?
Topic: dirname wanted
Replies: 17
Views: 19638

Of course, in an interactive session *LOAD-PATHNAME* is meaningless.
by scratchy
Thu Sep 02, 2004 3:16 pm
Forum: Anything else we might add?
Topic: dirname wanted
Replies: 17
Views: 19638

By the way, clisp has a built-in 'directory-namestring', which is essentially 'dirname', I was asking for in newLISP:

(defconstant *script-dir* (directory-namestring *LOAD-PATHNAME*))

(load (concatenate 'string *script-dir* "../lib/common.lsp"))

There you go.
by scratchy
Thu Sep 02, 2004 3:11 pm
Forum: Anything else we might add?
Topic: dirname wanted
Replies: 17
Views: 19638

(load "./lib/common.lsp") will load from the current directory's lib subdirectory. Current directory is variable. But the script should be able to figure out where it is located in the filesystem, and without 'dirname', it's impossible to do. Where do you want common.lsp to be? Anywhere, at a <i>fi...
by scratchy
Thu Aug 26, 2004 2:29 pm
Forum: Anything else we might add?
Topic: dirname wanted
Replies: 17
Views: 19638

Thank you. That brings us back to my point #2 above.
by scratchy
Wed Aug 25, 2004 10:41 pm
Forum: Anything else we might add?
Topic: dirname wanted
Replies: 17
Views: 19638

What's wrong with Lutz advice is that I don't want to write scripts that will work only with my init.lsp.[/quote]
by scratchy
Wed Aug 18, 2004 2:01 am
Forum: Anything else we might add?
Topic: dirname wanted
Replies: 17
Views: 19638

Lutz wrote:Actually you don't need to use backslash on Win32...
Lutz
??? This information does not help. How about the dirname built-in?
by scratchy
Tue Aug 17, 2004 7:44 pm
Forum: Anything else we might add?
Topic: dirname wanted
Replies: 17
Views: 19638

So it would take something like this:     (define (dirname path)         (if (= (& (nth 7 (sys-info)) 0x0F) 6)             (if (regex "(.*\\\\).*" path) $1 ".\\")             (if (regex "(.*/).*" path) $1 "./")))     (define *script-dir* (dirname (nth 1 (main-args)))) in the beginning of each script...
by scratchy
Mon Aug 16, 2004 1:43 pm
Forum: Anything else we might add?
Topic: dirname wanted
Replies: 17
Views: 19638

dirname wanted

Ok, here is a question: If I am writing several scripts, and I want to put reusable definitions into a separate file, for instance: /home/scratchy/bin/a.lsp <-- one script /home/scratchy/bin/b.lsp <-- another script /home/scratchy/lib/common.lsp <-- reusable stuff Obviously, in a.lsp and b.lsp I nee...
by scratchy
Mon Aug 16, 2004 1:27 pm
Forum: newLISP in the real world
Topic: multi-line command prompt -- huh?
Replies: 7
Views: 7682

Thanks for the replies. Looks like there are at least two ways to do it, which is technically fine. However the extra syntax on the command-line ([cmd]..[/cmd]) is something that I haven't seen in other shells, and is totally weird. Most shells maintain the same syntax in the script as in interactiv...
by scratchy
Sun Aug 15, 2004 12:45 am
Forum: newLISP in the real world
Topic: multi-line command prompt -- huh?
Replies: 7
Views: 7682

Looks like you have been pissing in your beer... too :-)
by scratchy
Sun Aug 15, 2004 12:21 am
Forum: Anything else we might add?
Topic: newLISP should be FREE (like in "free beer")
Replies: 7
Views: 9038

is that what you do on your period?
by scratchy
Sun Aug 15, 2004 12:18 am
Forum: Anything else we might add?
Topic: newLISP should be FREE (like in "free beer")
Replies: 7
Views: 9038

meaning?
by scratchy
Sun Aug 15, 2004 12:00 am
Forum: Anything else we might add?
Topic: newLISP should be FREE (like in "free beer")
Replies: 7
Views: 9038

newLISP should be FREE (like in "free beer")

Can anyone please explain, why would I use newLISP in my software (no matter how great it is) if I have to ask for a permission (who knows what it implies) to use it? When I don't know where Lutz is and how long he's going to be around? I'd rather use good old /bin/sh + homegrown cruft for my script...
by scratchy
Sat Aug 14, 2004 10:50 pm
Forum: newLISP in the real world
Topic: multi-line command prompt -- huh?
Replies: 7
Views: 7682

multi-line command prompt -- huh?

How come newlisp gives an error when I type or paste a multiline statement into comment prompt? For example: > (if (env BLAH) missing parenthesis : "...(if (env BLAH)\n" Of course, the paren is missing, because I haven't finished typing yet!!! The newlisp's IQ must be nil to give such an error, cons...