Re: Decomposing a URI into its components

Andrea Perego <andrea.perego@uninsubria.it> writes:
> 
> Thanks. Yes, this is what I did. However, this way I had to specify one
> rule for each URI component:
> 

...  stuff like:

> # Scheme
> 
>   {(?uri "^([^:/?#]+):") string:scrape ?scheme} => {?rsc uri:scheme
>     ?scheme} .

So, the nice trick would be to make sure your "uri" namespace prefix is
properly dereferenceable, so that once you've provided these
definitions, folks can just use uri:scheme, etc, as if they were
builtins.  I think that will work, or at least it should.  (You might
need to give cwm certain flags.  It's been some years since I used that
feature.)  If you think about what you're doing as providing a standard
library for parsing URIs, then it may not seem quite so messy.

     -- Sandro

Received on Monday, 14 May 2007 14:28:30 UTC