caveman
caveman copied to clipboard
Accessing param keywords
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
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|)
.
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.
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.