Page 1 of 1

Help on first time Dragonfly install

Posted: Thu Sep 08, 2011 5:23 am
by rickyboy
Hello all,

Pulled down dragonfly v070. Followed the directions to move .htaccess, index.cgi, and dragonfly-framework to DOCUMENT_ROOT.

Fired up Apache2, pointed to http://localhost in the browser and got:

Code: Select all

ERR: list expected : (parse-query QUERY_STRING)
called from user defined function load-once
called from user defined function load-files-in-dir
Looks like the scripts can't see the value of QUERY_STRING. It's certainly not a list. Tried changing the hash bang line on index.cgi to point right at newlisp. Still get the same message. Has anyone seen this before? Thanks for any help. --Rick

Re: Help on first time Dragonfly install

Posted: Thu Sep 08, 2011 9:18 am
by cormullion
Hi! Well, two blasts from the past - Ricky and Dragonfly, all in one post ... :) Nice to see you both.

I think Dragonfly is currently being resuscitated from a deep sleep in the lands of Abandonment. Don't know whether the original authors are still interested in it, but I gather that Kanen is going to absorb the frameworks and get them updated.

But to the point: I reproduced this error easily enough, and fixed it easily enough by changing line 174 of ./dragonfly-newlisp/example-site/dragonfly-framework/lib/request.lsp to

Code: Select all

(unless (empty? QUERY_STRING)
instead of

Code: Select all

when QUERY_STRING
I think that the empty string evaluates to true, so (when {} 1) evaluates the 1.

This may not be the cause of the problem, of course, merely the symptom. So plenty of scope for research!

Re: Help on first time Dragonfly install

Posted: Thu Sep 08, 2011 10:40 am
by rickyboy
Hey Pete! Good to hear from you too. Been a while.

Thanks from saving me from my laziness. :) (Hey, at least I admit it.). I will look at that piece of code in a few hours. It's still too early now in the British American Colonies.

I guess Dragonfly used to be the bee's knees and the authors have moved on? Wow, I'm so behind the times. Well, good luck to Kanen. I'll be interested to see what he comes up with.

Thanks again, my friend. --Ricky

Re: Help on first time Dragonfly install

Posted: Thu Sep 08, 2011 4:37 pm
by hilti
Hi Ricky!

Never got this error in Dragonfly, but Pete's solution looks good.
I'm the author of the first Dragonfly versions up to 0.5
Then Greg put in some very good code into the framework, but hard to read and maintain for me. That's why I don't feel like the "father of Dragonfly" anymore.

I've started a new web framework in newLISP inspired by some microframeworks / routing frameworks. It'll be ready in the next weeks.

I'm wondering why there are just a few web frameworks for newLISP?

Cheers
Marc aka Hilti

Re: Help on first time Dragonfly install

Posted: Thu Sep 08, 2011 5:06 pm
by rickyboy
Hello Marc!

Hey, that is great news about your new web framework. I am very interested in this, so I will try to keep looking back here for your announcement.

In the meantime, I will press on with Dragonfly. The code you and Greg provided is teaching me a lot about this type of work -- I'm way behind the curve in web tech -- so, thanks and kudos to you both.

cormullion, thanks for your fix: (1) it works, and (2) it seems to me The Right Thing To Do. :)

Best, --Ricky

Re: Help on first time Dragonfly install

Posted: Thu Sep 08, 2011 5:24 pm
by cormullion
Cool. If that turns out to be the problem, then a quick search for "(when ...)" suggests that it might be worth looking for similar uses.

Code: Select all

(when str
looks like a possible error if str is empty, although

Code: Select all

(when cookie
might be OK if cookie is a (possibly empty) list. Then what about

Code: Select all

(when request
or

Code: Select all

(when content
?

Then there's

Code: Select all

(unless
... :)

Re: Help on first time Dragonfly install

Posted: Thu Jun 28, 2012 8:04 pm
by itistoday
I think I fixed this issue via a different route:

Code: Select all

(unless (null? QUERY_STRING)
This should work then if QUERY_STRING is nil, where 'empty?' on 'nil' will cause an error. I updated my repo:

https://github.com/taoeffect/dragonfly-newlisp