Yuri Burger wrote:
> I have seen it, thanks. It works only with J6 and I does not know
> how to adopt it for J5. Another thing - your code does not split
> a parts of URL (protocol, domain, subdir, query...).
I don't have J5 installed on this machine, but any place that
has a syntax error probably is because J5 doesn't have the
noun verb verb fork.
So when you run into that, replace the noun of the fork with
an equivalent constant function.
Thus,
splitWord=: (0;split;a.e.' ',CRLF,TAB) ;: ]
becomes
splitWord=: (0;split;a.e.' ',CRLF,TAB)"_ ;: ]
And,
splitHead=: <;.1~ 0 = 4 {"1 (5;(states'');a.i.~CRLF,TAB) ;: ]
becomes
splitHead=: <;.1~ 0: = 4: {"1 (5;(states'');a.i.~CRLF,TAB)"_ ;: ]
Likewise,
nameValue=: (0;(states'');a.e.':') ;: ]
becomes
nameValue=: (0;(states'');a.e.':')"_ ;: ]
(though, of course, (states'') needs to be followed by
the body of the sequential machine).
And you're right that I didn't put together a sequential
machine for breaking apart the url. Much of that would
be unneeded on a web server, though some would be quite
useful.
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm