unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Panicz Maciej Godek <godek.maciek@gmail.com>
To: Matt Wette <mwette@alumni.caltech.edu>
Cc: "guile-user@gnu.org" <guile-user@gnu.org>
Subject: Re: syncase code issue 1.8.8 -> 2.0.11
Date: Thu, 18 Sep 2014 09:49:27 +0200	[thread overview]
Message-ID: <CAMFYt2b6u-mgwOtWYw19kDvk0+J6LEjQiPcMMhW2DPkNJ03UJw@mail.gmail.com> (raw)
In-Reply-To: <2097C007-9993-4AA1-A5F7-209A7DADD6CE@alumni.caltech.edu>

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

2014-09-18 3:18 GMT+02:00 Matt Wette <mwette@alumni.caltech.edu>:

> Hi Folks,
>
> Anyone interested in looking at my syntax-case code?   I wrote this
> several years ago under 1.8.8.  Now moving to 2.0.11: not working :(.
>
> Matt
>
>

> [...]
> In 1.8.8, I get the above output.   In 2.0.11 I get
>
> Syntax-case macros are now a part of Guile core; importing (ice-9 syncase)
> is no longer necessary.   <=(no issue here)
> ice-9/psyntax.scm:1274:12: In procedure dobody:
> ice-9/psyntax.scm:1274:12: Syntax error:
> u1.scm:106:18: definition in expression context, where definitions are not
> allowed


I haven't time to look at your code more closely, but the error message is
quite informative here: clearly the usage of your macro introduces a
definition in expression context, which doesn't conform to the Scheme
specification. It seems that guile 1.8 treated definitions like
expressions, but it is no longer the case.

Apparently, your code expands to a series of definitions. Therefore the
invocation

(format #t "~a\n" (define-tokenizer tokiz ("[0-9]+" #\1) ("[a-z]+" #\a)))

makes no sense (e.g. because "define-tokenizer" produces no value, that
should be passed to format, and after expansion it contains no expression
that could be evaluated), and neither does

(format #t "~a\n" (define mt (make-tokiz "abc=def")))

I don't know what was your intention in the first case, but you could
rearrange the second line in the following way:

(define mt (make-tokiz "abc=def"))
(format #t "~a\n" mt)

The first line could simply be replaced with the sole definition, i.e.
(define-tokenizer tokiz ("[0-9]+" #\1) ("[a-z]+" #\a))

(I am guessing that the invocation from within "format" stems from
debugging)

regards

[-- Attachment #2: Type: text/html, Size: 2707 bytes --]

  reply	other threads:[~2014-09-18  7:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18  1:18 syncase code issue 1.8.8 -> 2.0.11 Matt Wette
2014-09-18  7:49 ` Panicz Maciej Godek [this message]
2014-09-18 10:20 ` Taylan Ulrich Bayirli/Kammer
2014-09-18 12:35   ` Matt Wette
  -- strict thread matches above, loose matches on Subject: below --
2014-09-18 14:08 mwette
2014-09-19  3:54 ` Matt Wette

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=CAMFYt2b6u-mgwOtWYw19kDvk0+J6LEjQiPcMMhW2DPkNJ03UJw@mail.gmail.com \
    --to=godek.maciek@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=mwette@alumni.caltech.edu \
    /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).