From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Panicz Maciej Godek Newsgroups: gmane.lisp.guile.user Subject: Re: syncase code issue 1.8.8 -> 2.0.11 Date: Thu, 18 Sep 2014 09:49:27 +0200 Message-ID: References: <2097C007-9993-4AA1-A5F7-209A7DADD6CE@alumni.caltech.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c33fde4fa940050352396e X-Trace: ger.gmane.org 1411026597 2260 80.91.229.3 (18 Sep 2014 07:49:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Sep 2014 07:49:57 +0000 (UTC) Cc: "guile-user@gnu.org" To: Matt Wette Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Sep 18 09:49:50 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XUWTO-0001N3-4C for guile-user@m.gmane.org; Thu, 18 Sep 2014 09:49:50 +0200 Original-Received: from localhost ([::1]:48980 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUWTN-0006qH-9H for guile-user@m.gmane.org; Thu, 18 Sep 2014 03:49:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUWTA-0006oS-Sc for guile-user@gnu.org; Thu, 18 Sep 2014 03:49:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUWT7-0001Oy-VG for guile-user@gnu.org; Thu, 18 Sep 2014 03:49:36 -0400 Original-Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:36424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUWT7-0001OC-Ls for guile-user@gnu.org; Thu, 18 Sep 2014 03:49:33 -0400 Original-Received: by mail-wi0-f182.google.com with SMTP id e4so645428wiv.9 for ; Thu, 18 Sep 2014 00:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=4GKiIebZ7YcNWAA88UBj7Gt46FCcpmb7l25fBZsGDQU=; b=vwHF/6gd4kGuUwkyhKZGIWJUm0tADwNJ3fbGFLJw+QH0t8hChRghEpXJaA3eyiNNLQ Di4OsGvsBVi/AJrIf7ofyQwGw4Hc5KaK7Xadxg1J4e4TjI90YHkFPaB5AM7QJMZ5jRaL C6KJqcY9LRd4L6fsAX3fUvrxRZgkxY2Ptzcmnx5YiHUF4MeNKvmxo/SWxoC8vg4BVI1C lB9kJRGOsEj1OcLJIOdN7gOm8FxqLMFfF5x8/7kB5utMcLfIlCLTkNHKtDHNbXeSXwGr O/1OulobrGXIvDBQ8WnrYJXXvxlhrun8P51E9k4+rfASJD19BRkL7tqjJcpcrsMtwya1 MSvg== X-Received: by 10.180.183.163 with SMTP id en3mr39201957wic.36.1411026567275; Thu, 18 Sep 2014 00:49:27 -0700 (PDT) Original-Received: by 10.194.45.134 with HTTP; Thu, 18 Sep 2014 00:49:27 -0700 (PDT) In-Reply-To: <2097C007-9993-4AA1-A5F7-209A7DADD6CE@alumni.caltech.edu> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::236 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11526 Archived-At: --001a11c33fde4fa940050352396e Content-Type: text/plain; charset=UTF-8 2014-09-18 3:18 GMT+02:00 Matt Wette : > 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 --001a11c33fde4fa940050352396e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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?=C2=A0 =C2=A0I wrote th= is several years ago under 1.8.8.=C2=A0 Now moving to 2.0.11: not working := (.

Matt

=C2=A0
[...]
In 1.8.8, I get the above output.=C2=A0 =C2=A0In 2.0.11 I get

Syntax-case macros are now a part of Guile core; importing (ice-9 syncase) = is no longer necessary.=C2=A0 =C2=A0<=3D(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, whi= ch doesn't conform to the Scheme specification. It seems that guile 1.8= treated definitions like expressions, but it is no longer the case.
<= div>
Apparently, your code expands to a series of definitions= . Therefore the invocation

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

makes no sense (e.g. because "define-to= kenizer" 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=3Ddef")))=C2=A0

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

(define mt (make= -tokiz "abc=3Ddef"))
(format #t "~a\n&quo= t; mt)=C2=A0

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

<= div>(I am guessing that the invocation from within "format" stems= from debugging)

regards
--001a11c33fde4fa940050352396e--