Help on first time Dragonfly install

Started by rickyboy, September 07, 2011, 10:23:21 PM

Previous topic - Next topic

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">http://localhost in the browser and got:


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
(λx. x x) (λx. x x)

cormullion

#1
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


(unless (empty? QUERY_STRING)

instead of


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!

rickyboy

#2
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
(λx. x x) (λx. x x)

hilti

#3
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
--()o Dragonfly web framework for newLISP

http://dragonfly.apptruck.de\">http://dragonfly.apptruck.de

rickyboy

#4
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
(λx. x x) (λx. x x)

cormullion

#5
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. (when str looks like a possible error if str is empty, although (when cookie might be OK if cookie is a (possibly empty) list. Then what about(when request or (when content?



Then there's (unless ... :)

itistoday

#6
I think I fixed this issue via a different route:


(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">https://github.com/taoeffect/dragonfly-newlisp
Get your Objective newLISP groove on.