unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
Cc: guile-user@gnu.org
Subject: Re: values->list elements
Date: Tue, 13 Jun 2006 15:24:45 -0700	[thread overview]
Message-ID: <448F3B2D.1010300@bothner.com> (raw)
In-Reply-To: <448F367A.8010309@fastmail.fm>

If you make "multiple values" first-class then you get into an
interesting and useful design space.  See the XQuery language
(http://www.w3.org/XML/Query and http://www.w3.org/TR/xquery/).
Its values are "sequences" of "items".  The difference between a
list and a sequence is that sequences don't nest directly - and
there is no difference between an item and a sequence of length 1.
You can handle nesting by wrapping a sequence in a node or object
(though the latter goes beyond the XQuery data model).

XQuery doesn't goes as far as it could, because a parameter
list is not a sequence, but a list of sequences.  It would be
cleaner to define a parameter list as a sequence, and then
use pattern matching to split the sequence into parameters.

Sequences are nice because they're the natural result of
"statements" such are loops (see XQuery's FLOWR expressions)
or "blocks" (bodies in Scheme).

In Kawa XQuery sequence and Scheme multiple values are
implemented the same way.

Articles where I explore / ramble on this idea:
http://www.gnu.org/software/kawa/q2/
http://per.bothner.com/papers/LispXML04/index.html
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


      reply	other threads:[~2006-06-13 22:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-13  1:19 values->list elements Jon Wilson
2006-06-13 17:20 ` szgyg
2006-06-13 19:02   ` Jonathan Wilson
2006-06-16  5:51     ` szgyg
2006-06-16  8:00       ` Neil Jerram
2006-06-16 18:15         ` szgyg
2006-06-19  0:51           ` Jon Wilson
2006-06-19  1:12             ` Per Bothner
2006-06-13 21:14   ` Neil Jerram
2006-06-13 21:17 ` Neil Jerram
2006-06-13 22:04   ` Jonathan Wilson
2006-06-13 22:24     ` Per Bothner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=448F3B2D.1010300@bothner.com \
    --to=per@bothner.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).