Hi Alex,

>> It seems to me that it won't be easy to make use of the Pico Lisp URL
>> encoding system when using jQuery AJAX calls like getJSON, as jQuery
>> uses
>> the more traditional key-value style (http://...?k1=v1&k2=v2...). Is
>> there
>
> No problem at all, I think. It is all there.
>
> The arguments following the '?' in an URL are processed in such a way
> that patterns of the form Variable=Value are executed as separate
> assignments, and only the remaining values are passed as arguments. For
> example, the URL
>
>    http://[EMAIL PROTECTED]&*Var1=444&+abc&*Var2=def&xyz
>
> will assign the number '444' to '*Var1' and the string "def" to '*Var2',
> and then call 'foo' with three arguments (a number '123', an internal
> symbol 'abc', and a string "xyz").
>
> You must know, however, that for security reasons these assignments to
> global variables will work only if the variable's names start with an
> asterisk (in addition to the standard constraint that these variables
> must be "allowed"). Other plain symbols (like 'k1' in your example) will
> get the value ("v1") stored in the property 'http' instead of the value
> cell.
>
> Cheers,
> - Alex

As long as the "Variable=Value" URL form in Pico Lisp is limited to the
use of global variables, there are two problems:
1) How can you know how many (and which) variables that the request
contained?
2) Setting up the URL data to be used in the jQuery.getJSON call will be a
bit more work, as instead of writing data={*X=11, *Y=22} you have to do
this:
data={};
data["*X"]=11;
data["*Y"]=22;

For some reason I've had problems with string variables containing
letters. data["*Y"]="22" works, but data["*Y"]="2x2" don't. I'll try these
kind of data against another kind of server to see where the problem is.

/Jon
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]

Reply via email to