fukamachi / caveman

Lightweight web application framework for Common Lisp.
http://8arrow.org/caveman/
782 stars 63 forks source link

Accessing param keywords #22

Open vityok opened 11 years ago

vityok commented 11 years ago

Hi, I am not sure, but it looks like the proper way to access params is using a kind of literal keywords:

(getf params :|customer-name|)

instead of

(getf params :customer-name)

Could somebody please clarify this issue and explain in the readme.

Thanks

vityok commented 11 years ago

One more case of a slight inconsistency.

It appears that this actually depends on where the param comes from: if it is a part of a function route, then it should be accessed as a simple keyword, like (getf params :id) but if it is submitted in a POST request, then it must be accessed using a literal keyword (getf params :|id|).

rapenne-s commented 11 years ago

I have had this problem, I'm now using upper case name in my html page and the param is :id . This is a workaround that works fine for me.

vityok commented 11 years ago

I suspect that this is how parameter names are interned and probably this can be actually implementation-dependent. Without looking at the sources or CLHS it is hard to tell but as it is now it is not as much an issue as a lack of a hint in the documentation.

But of course, having a unified access mode to the params would be useful.