unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* screwy alist syntax
@ 2004-04-15 23:11 Brian S McQueen
  2004-04-16  1:10 ` Paul Jarc
  2004-04-16 21:04 ` Stephen Compall
  0 siblings, 2 replies; 3+ messages in thread
From: Brian S McQueen @ 2004-04-15 23:11 UTC (permalink / raw)


I just noticed something that looks screwy.  Is there a good reason for
the following?

The assq func take a key and an alist:

assq key alist
assv key alist
assoc key alist
scm_assq (key, alist)
scm_assv (key, alist)
scm_assoc (key, alist)

BUT the assq-ref func take an alist and a key, which is the opposite
order:

assq-ref alist key
assv-ref alist key
assoc-ref alist key
scm_assq_ref (alist, key)
scm_assv_ref (alist, key)
scm_assoc_ref (alist, key)

I think these should two classes of functions should have their args in
the same order.

Brian McQueen
NAS Division
NASA/Ames


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: screwy alist syntax
  2004-04-15 23:11 screwy alist syntax Brian S McQueen
@ 2004-04-16  1:10 ` Paul Jarc
  2004-04-16 21:04 ` Stephen Compall
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Jarc @ 2004-04-16  1:10 UTC (permalink / raw)
  Cc: guile-user

Brian S McQueen <bqueen@nas.nasa.gov> wrote:
> I just noticed something that looks screwy.  Is there a good reason for
> the following?

Whether there was a good reason when these procedures were invented, I
can't say.  (ass*-ref and other *-ref procedures follow the same
pattern among themselves, at least.)  But backward compatibility is a
good reason now for them to stay the way they are.


paul


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: screwy alist syntax
  2004-04-15 23:11 screwy alist syntax Brian S McQueen
  2004-04-16  1:10 ` Paul Jarc
@ 2004-04-16 21:04 ` Stephen Compall
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Compall @ 2004-04-16 21:04 UTC (permalink / raw)
  Cc: guile-user

Brian S McQueen <bqueen@nas.nasa.gov> writes:

> I just noticed something that looks screwy.  Is there a good reason for
> the following?
> 
> The assq func take a key and an alist:
> 
> assq key alist
> ...
> BUT the assq-ref func take an alist and a key, which is the opposite
> order:
> 
> assq-ref alist key
> ...

Just making up stuff here, but I think that `assq' et al are historic
Lisp functions, and so were left as they were.  However, `assq-ref' et
al are new, so can have the `right' order.  They aren't in Emacs,
anyway.

--
Stephen Compall or s11 or sirian

Most people's favorite way to end a game is by winning.

Mena monarchist AFSPC analyzer arrangements quarter Ft. Bragg
MILSATCOM BRLO Consul Reno kilo class Europol JFK Roswell


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-04-16 21:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-15 23:11 screwy alist syntax Brian S McQueen
2004-04-16  1:10 ` Paul Jarc
2004-04-16 21:04 ` Stephen Compall

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).