unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: John Cowan <cowan@ccil.org>
To: Joshua Branson <jbranso@fastmail.com>
Cc: guile-user@gnu.org
Subject: Re: lat? and atom? not in guile?
Date: Tue, 19 Jun 2018 12:46:01 -0400	[thread overview]
Message-ID: <CAD2gp_QTtOpx_G_j=C22AbgGQ3g61q05FnrK=W7NY=noNWDtRg@mail.gmail.com> (raw)
In-Reply-To: <877emuyfcp.fsf@fastmail.com>

Neither is part of any Scheme standard.  Most Schemes that define atom?,
define it as (lambda (x) (not (pair? x)), tracking the standard Common Lisp
definition.  But TLS excludes () from atoms as well.  The definition used
by TLS is on p. xiii of the fourth edition:

(define atom?
  (lambda (x)
    (and
      (not (pair? x))
      (not (null? x)))))

As for lat?, it is a non-standard acronym for "list of atoms".  It is
defined on page 16:

(define lat?
  (lambda (l)
    (cond
      ((null? l) #t)
      ((atom? (car l)) (lat? (cdr l)))
      (else #f))))


I have rewritten this from TLS's dialect to use standard #t and #f instead
of t and nil.


On Tue, Jun 19, 2018 at 11:18 AM, Joshua Branson <jbranso@fastmail.com>
wrote:

>
> Hello,
>
> This question comes from a non-scheme guy.  I'm not trying to be
> critical of guile.  I'm just curious.
>
> So I have the book "The Little Schemer".  The book describes the
> procedures: "lat?" and "atom?".  Surprisingly, guile does not seem to
> define these procedures by default.  I had assumed that these procedures
> were apart of standard scheme, but I guess that is not the case.
>
> Is there any plan to define these procedures?
>
> Thanks,
>
> Joshua
>
>


  parent reply	other threads:[~2018-06-19 16:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19 15:18 lat? and atom? not in guile? Joshua Branson
2018-06-19 16:13 ` Thompson, David
2018-06-20 14:37   ` Joshua Branson
2018-06-20 14:40     ` John Cowan
2018-06-20 14:55       ` Thompson, David
2018-06-20 16:55         ` Joshua Branson
2018-06-20 23:47         ` Scheme books [was: lat? and atom? not in guile?] Matt Wette
2018-06-21 13:44           ` Joshua Branson
2018-06-21 14:01             ` Matt Wette
2018-06-20 16:54       ` lat? and atom? not in guile? Joshua Branson
2018-06-19 16:46 ` John Cowan [this message]
     [not found] <mailman.107.1529424021.11270.guile-user@gnu.org>
2018-06-19 17:33 ` Zelphir Kaltstahl
2018-06-20 10:15   ` Shakthi Kannan
2018-06-20 14:33     ` Joshua Branson

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='CAD2gp_QTtOpx_G_j=C22AbgGQ3g61q05FnrK=W7NY=noNWDtRg@mail.gmail.com' \
    --to=cowan@ccil.org \
    --cc=guile-user@gnu.org \
    --cc=jbranso@fastmail.com \
    /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).