Hi Henrik,

> That means that if you for example post "hello" to a PL server and use
> "greeting" as the key you can access "hello" anywhere in your code by
> way of (get 'greeting 'http) so you can imagine the headaches that can

Hmm, I think this was not the question Jon had in mind. But, ok, what
you refer to is a usage of properties.

This "feature" of the HTTP server is actually not the intended usage.

Allowing arbitrary tokens for HTTP variables was just an afterthought to
allow limited communication with non-PicoLisp clients. The PicoLisp
application server doesn't use it, instead it relies on a few
well-defined globals per application (required to start with an
asterisk, and being explicitly 'allow'ed), and mainly dynamically
generated globals for the 'form' contents (of the form *Gui(123) or
*Gui(-123)).

I don't have a single application that uses this (get 'xxx 'http).


> arise if you start using 'greeting in your code and overwrite the data
> you have posted.

Well, this is the same problem as with all other globals. If you 'allow'
a token like 'greeting' to be referred to from a client, you must make
sure that the application doesn't use it otherwise. Anyway, as I said,
the recommended way would be a global '*Greeting', this gives a cleaner
separation.



> I don't know why Alex chose to do like this and not have some single
> global symbol that could be queried instead like for instance (get
> 'http-request 'greeting) or something.

This would also be a possibility, but would not make a real difference.
Instead of the symbol 'greeting', you now make 'http-request' global.
The current way of 'get'ting 'http' from the query symbol is more
efficient. If you put all query symbols into the property list of a
single global symbol like 'http-request', access might become rather
inefficient if there are potentially many such symbols (as properties
are stored in a list).

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to