Re: Ann: URI quasiquotes library
Jan Wielemaker <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
On 07/08/2013 04:30 PM, Michael Hendricks wrote: > On Sun, Jul 7, 2013 at 6:58 PM, Richard A. O'Keefe <[email protected]>wrote: > >> On 6/07/2013, at 9:56 AM, Michael Hendricks wrote: >>> >>> 'relative URI reference' :- >>> __uri_qq_base = 'https://example.org/path/', >>> U = {|uri||to/resource|}, >>> U = {|uri||/path/to/resource|}, >>> U = 'https://example.org/path/to/resource'. >> >> Why can't this be something like >> >> 'relative URI reference' :- >> {|with_uri_base|https://example.org/path/|}, >>> U = {|uri||to/resource|}, >>> U = {|uri||/path/to/resource|}, >>> U = 'https://example.org/path/to/resource'. >> > > Good idea. I'll see if I can make that work. Nice. Not sure how useful it is to set a base URI inside a clause. I can't really recall the last time I had to construct multiple URIs in the same clause. You could also go for: {|uri(Base)||to/resource|}, Glancing the code, and also from previous experience, we probably need some functional notation library. Functions come very handy with quasi quotations as some of the work always needs to be done at runtime. However, this functional notation need not be readable for the user. Possibly we should introduce a functional notation library that does not affect normal Prolog syntax, but can be enabled by default. Something like '$EVAL'(Term). Cheers --- Jan