Search found 14 matches

by ghyll
Sun Aug 09, 2015 6:53 am
Forum: Dragonfly
Topic: How to tell if route_cgi.lsp is running?
Replies: 10
Views: 4809

Re: How to tell if route_cgi.lsp is running?

A "submit" button on index.nhtml POSTs to script.nl. Instead of getting the desired/expected response from script.nl, I get the full text of the script file. Changing 'LOG_LEVEL to 'LOG_DEBUG resulted in malloc errors and segmentation faults, which I'm unsure how to troubleshoot. The dragonfly.log ...
by ghyll
Fri Jun 12, 2015 6:20 am
Forum: newLISP in the real world
Topic: do trailing spaces cause (file? x) to return nil?
Replies: 2
Views: 1783

Re: do trailing spaces cause (file? x) to return nil?

ralph.ronnquist wrote:Maybe you overlook that directory only returns file base names, without the path prefix?
D'oh! You're completely correct. I forgot to move Terminal from my "newlisp" directory to where it should have been. Thank you :)
by ghyll
Wed Jun 10, 2015 3:19 am
Forum: newLISP in the real world
Topic: do trailing spaces cause (file? x) to return nil?
Replies: 2
Views: 1783

do trailing spaces cause (file? x) to return nil?

I have a few directories full of files named with trailing spaces. I thought this would remove the trailing spaces, but it only returns nil. (dolist (x (directory path)) (rename-file x (trim x)) ) I tried debugging by using (trace true) with the following code: (dolist (x (directory path)) (file? x)...
by ghyll
Tue May 19, 2015 5:52 am
Forum: Dragonfly
Topic: How to tell if route_cgi.lsp is running?
Replies: 10
Views: 4809

Re: How to tell if route_cgi.lsp is running?

You should use the DF:log-info , DF:log-warn and DF:log-err functions to send debug statements to the dragonfly.log file (which is specified by the LOG_FILE_PATH variable in config.lsp ). Changing 'LOG_LEVEL to 'LOG_DEBUG resulted in malloc errors and segmentation faults, which I'm unsure how to tr...
by ghyll
Tue May 12, 2015 5:25 pm
Forum: Dragonfly
Topic: How to tell if route_cgi.lsp is running?
Replies: 10
Views: 4809

Re: How to tell if route_cgi.lsp is running?

Hi Marc, thanks for the help :) Unfortunately, the code is proprietary, so I can't take advantage of your offer to check a ZIP. 1. .nhtml is for views containing newLISP code, and .html is for views without -- just an easy way to check at a glance. 2. The .nl script is not RESTful, so I don't think ...
by ghyll
Tue May 12, 2015 6:39 am
Forum: Dragonfly
Topic: How to tell if route_cgi.lsp is running?
Replies: 10
Views: 4809

How to tell if route_cgi.lsp is running?

tldr: How do I tell whether route_cgi.lsp is running? A "submit" button on index.nhtml POSTs to script.nl. Instead of getting the desired/expected response from script.nl, I get the full text of the script file. index.nhtml and script.nl are both in /views, and route_cgi.lsp is in /plugins-active......
by ghyll
Mon Dec 22, 2014 7:28 pm
Forum: newLISP in the real world
Topic: need help understanding letex
Replies: 7
Views: 1881

Re: need help understanding letex

Were you referring to a specific part? Without the single quotes, the newLISP interpreter tries to evaluate the streams using implicit indexing. This doesn't work, because (for example) there is no 998th list item in `(998 (lambda () (enum-interval-descending (- 998 1) 100)))` http://www.newlisp.org...
by ghyll
Mon Dec 22, 2014 1:32 am
Forum: newLISP in the real world
Topic: syntax for apply
Replies: 2
Views: 1661

Re: syntax for apply

That makes perfect sense. Thank you for the reply (and apologies for the delayed response on my part).
by ghyll
Mon Dec 22, 2014 1:27 am
Forum: newLISP in the real world
Topic: need help understanding letex
Replies: 7
Views: 1881

Re: need help understanding letex

I’m new to programming, so I don’t know how one programs in Scheme or other traditional LISP implementations. Thanks for the help with streams! Using contexts with push/pop seems like a much easier way to manage the streams than trying to manipulate letex and expand for each function. I’d still like...
by ghyll
Sun Dec 21, 2014 7:35 am
Forum: newLISP in the real world
Topic: need help understanding letex
Replies: 7
Views: 1881

Re: need help understanding letex

I assumed it was unnecessary because I was asking a syntax question, but I'm told I should post all of my code. Apologies for length and bugs. (set 'the-empty-stream '()) (define-macro (cons-stream) (letex (x (args 0) y (args 1)) (cons x (list (delay y))) ) ) (define-macro (delay) (letex (x (args 0)...
by ghyll
Sun Dec 21, 2014 7:14 am
Forum: newLISP in the real world
Topic: need help understanding letex
Replies: 7
Views: 1881

need help understanding letex

My code is a mess, and I apologize. I'm a newbie, and I got stuck trying to work out one of the bugs. I'm trying to learn newLISP by solving some of the Project Euler problems. I'm currently working on Problem 4 using streams, using some functions from http://www.newlispfanclub.alh.net/forum/viewtop...
by ghyll
Thu Oct 30, 2014 5:26 am
Forum: newLISP in the real world
Topic: syntax for apply
Replies: 2
Views: 1661

syntax for apply

This code (shown below) from the "Namespace context switching" section of " Expression Evaluation in newLISP " does not seem to follow the syntax given in the manual: (apply func list [int-reduce]). (context 'Foo) (set 'var 123) (define (func) (println "current context: " (context)) (println "var: "...
by ghyll
Tue Sep 09, 2014 6:58 pm
Forum: newLISP in the real world
Topic: typo in the newLISP manual? (pop)
Replies: 1
Views: 1306

typo in the newLISP manual? (pop)

I think I found a typo in the pop function section of the newLISP manual. (set 'pList '((f g) a b c "hello" d e 10)) (pop pList) → (f g) (pop pList) → a pList → (b c "hello" d e 10) (pop pList 3) → d (pop pList 100) → 10 As-is, (pop pList 100) produces an invalid index error. The line should probabl...
by ghyll
Thu Aug 21, 2014 3:51 am
Forum: newLISP in the real world
Topic: typo in the newLISP manual?
Replies: 1
Views: 1495

typo in the newLISP manual?

I think I found a typo in one of the code snippets in the ref function section of the newLISP manual. ; get index vectors for list elements (set 'pList '(a b (c d (x) e))) (ref 'x pList) → (2 2 0) (ref '(x) pList) → (2 2) ; the key expression is in a variable (set 'p '(c d (x) e)) (ref p pList p) → ...