unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Help with macro
@ 2002-11-22 14:47 jblazi
  2002-11-22 15:54 ` Joshua Judson Rosen
  0 siblings, 1 reply; 2+ messages in thread
From: jblazi @ 2002-11-22 14:47 UTC (permalink / raw)


How can I write the following macro in Guile:

(define-syntax defpoint
  (syntax-rules
    ()
    ( (defpoint p) (display "ERROR"))
    ( (defpoint p p-tupel) (define p (apply point 'p-tupel)))
    ( (defpoint p p-tupel pp ...) (begin (defpoint p p-tupel) (defpoint pp 
...)))))


Another question: Is there a "scm_c_eval_file"?

TIA,
-- 
Janos Blazi



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


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

* Re: Help with macro
  2002-11-22 14:47 Help with macro jblazi
@ 2002-11-22 15:54 ` Joshua Judson Rosen
  0 siblings, 0 replies; 2+ messages in thread
From: Joshua Judson Rosen @ 2002-11-22 15:54 UTC (permalink / raw)
  Cc: guile-user

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

On Fri, Nov 22, 2002 at 03:47:58PM +0100, jblazi wrote:
> How can I write the following macro in Guile:
> 
> (define-syntax defpoint
>   (syntax-rules
>     ()
>     ( (defpoint p) (display "ERROR"))
>     ( (defpoint p p-tupel) (define p (apply point 'p-tupel)))
>     ( (defpoint p p-tupel pp ...) (begin (defpoint p p-tupel) (defpoint pp 
> ...)))))

Just like that.

However, you must first:

        (use-syntax (ice-9 syncase))

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2002-11-22 15:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-22 14:47 Help with macro jblazi
2002-11-22 15:54 ` Joshua Judson Rosen

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