I would like to make a link where once clicked there will be some processing and the an HTTP redirect to a different, second link. I would like this second link to be what shows up on the top of the browser as the new url.
All this redirecting still doesn't get me what I want.
I would like this second link to be what shows up on the top of the browser as the new url. -- but I would also like that page to be initialized with parameters I could express so far only with a closure.
I don't want to pass those parameters to the second link, because then they'll be visible.
So now I need to first save these initialization parameters somewhere (much like saving a closure) and modify the second link to check if there are any scheduled parameters to initialize itself with for a particular user. Some sort of defop-init.
(Am I missing something?)
Down the drain go closures when combined with redirection.
Why not just pass a session id/key to the second URL* and allow that new page to retrieve the data you don't want exposed?
*or use a hidden field on a form submit.
BTW the limitations you're hitting have nothing to do with Arc or Closures, but rather are just limitations of Browser/HTTP technology (which are by design).
arc> ([(prn "You entered " _)] 34)
You entered 34
Error: "...urces/arc/ac.scm:974:33: arity mismatch;\n the expected number of arguments does not match the given number\n expected: 1\n given: 0"
Do you see something different? I think your defop expression is also incorrect. It just happens to have the right side-effect before it runs into the error. You probably have errors at the server -- that aren't visible on the browser.
arc> ([(prn "You entered " _)] 34)
You entered 34
Error: "car: expects argument of type <pair>; given ()"
That's good investigation. Note the work described in this thread uses Arc 3.1, not Anarki.
Btw do you mean there's something wrong with defop, or that the example I wrote is incorrect? I had gotten that example from: http://arcfn.com/doc/srv.html