caveman icon indicating copy to clipboard operation
caveman copied to clipboard

Accessing param keywords

Open vityok opened this issue 11 years ago • 3 comments

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 avatar Sep 27 '13 16:09 vityok

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

vityok avatar Sep 28 '13 21:09 vityok

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.

rapenne-s avatar Sep 30 '13 14:09 rapenne-s

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.

vityok avatar Sep 30 '13 15:09 vityok