unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* problems with the docs
@ 2010-10-10 22:40 maledetto
  2010-10-11 21:21 ` Andy Wingo
  0 siblings, 1 reply; 2+ messages in thread
From: maledetto @ 2010-10-10 22:40 UTC (permalink / raw)
  To: guile-user

hello

i'm trying to learn about scheme/guile-2.0 and the language module. but
the given compilers use some constructs i don't understand and can't
find explanation to. for example, i can't find explanation to pmatch or
emit. these procedures are also not listed in the procedure index.

regards,
maledetto <maledetto@online.de>



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

* Re: problems with the docs
  2010-10-10 22:40 problems with the docs maledetto
@ 2010-10-11 21:21 ` Andy Wingo
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Wingo @ 2010-10-11 21:21 UTC (permalink / raw)
  To: maledetto; +Cc: guile-user

Hi,

On Mon 11 Oct 2010 00:40, maledetto@online.de writes:

> i'm trying to learn about scheme/guile-2.0 and the language module. but
> the given compilers use some constructs i don't understand and can't
> find explanation to. for example, i can't find explanation to pmatch or
> emit. these procedures are also not listed in the procedure index.

The manual aims to explain the interfaces that Guile offers to the
programmer. It would be much longer if it explained everything about
the implementation itself :) So many things you will find, you will have
to puzzle out yourself, or otherwise ask.

In this case, pmatch is a pattern matcher. Instead of writing:

(lambda (x)
  (if (and (pair? x) (eq? (car x) 'foo))
      (let ((bar (cdr x)))
        (* 2 bar))))

you can write

(lambda (x)
  (pmatch x
    ((foo . ,bar)
     (* 2 bar))))

`Emit' is a local variable in the compiler.

Have fun with Guile,

Andy
-- 
http://wingolog.org/



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

end of thread, other threads:[~2010-10-11 21:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-10 22:40 problems with the docs maledetto
2010-10-11 21:21 ` Andy Wingo

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