DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(guile.info.gz) SRFI-2

Info Catalog (guile.info.gz) SRFI-1 (guile.info.gz) SRFI Support (guile.info.gz) SRFI-4
 
 39.4 SRFI-2 - and-let*
 ======================
 
 The syntactic form `and-let*' combines the conditional evaluation form
 `and' with the binding form LET*.  Each argument expression will be
 evaluated sequentially, bound to a variable (if a variable name is
 given), but only as long as no expression returns the false value `#f'.
 
    Use `(use-modules (srfi srfi-2)' to access this syntax form.
 
    A short example will demonstrate how it works.  In the first
 expression, X will get bound to 1, but the next expression (`#f') is
 false, so evaluation of the form is stopped, and `#f' is returned.  In
 the next expression, X is bound to 1, Y is bound to `#t' and since no
 expression in the binding section was false, the body of the `and-let*'
 expression is evaluated, which in this case returns the value of X.
 
      (and-let* ((x 1) (y #f)) 42)
      =>
      #f
      (and-let* ((x 1) (y #t)) x)
      =>
      1
 
Info Catalog (guile.info.gz) SRFI-1 (guile.info.gz) SRFI Support (guile.info.gz) SRFI-4
automatically generated byinfo2html