Help on first time Dragonfly install

A web framework in newLISP
Locked
rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Help on first time Dragonfly install

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

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: Help on first time Dragonfly install

Post 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!

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: Help on first time Dragonfly install

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

hilti
Posts: 140
Joined: Sun Apr 19, 2009 10:09 pm
Location: Hannover, Germany
Contact:

Re: Help on first time Dragonfly install

Post 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
--()o Dragonfly web framework for newLISP
http://dragonfly.apptruck.de

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: Help on first time Dragonfly install

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

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: Help on first time Dragonfly install

Post 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
... :)

itistoday
Posts: 429
Joined: Sun Dec 02, 2007 5:10 pm
Contact:

Re: Help on first time Dragonfly install

Post 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
Get your Objective newLISP groove on.

Locked