From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Taylan Ulrich Bayirli/Kammer Newsgroups: gmane.lisp.guile.user Subject: Re: syncase code issue 1.8.8 -> 2.0.11 Date: Thu, 18 Sep 2014 12:20:05 +0200 Message-ID: <87k351ut62.fsf@taylan.uni.cx> References: <2097C007-9993-4AA1-A5F7-209A7DADD6CE@alumni.caltech.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1411036055 25851 80.91.229.3 (18 Sep 2014 10:27:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Sep 2014 10:27:35 +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 12:27:31 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 1XUYvw-0002y9-VD for guile-user@m.gmane.org; Thu, 18 Sep 2014 12:27:29 +0200 Original-Received: from localhost ([::1]:49689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUYvw-0000Su-AY for guile-user@m.gmane.org; Thu, 18 Sep 2014 06:27:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUYvl-0000R1-Q6 for guile-user@gnu.org; Thu, 18 Sep 2014 06:27:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUYvk-0001bG-2F for guile-user@gnu.org; Thu, 18 Sep 2014 06:27:17 -0400 Original-Received: from mail-la0-x22c.google.com ([2a00:1450:4010:c03::22c]:62115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUYvj-0001Ws-Q0 for guile-user@gnu.org; Thu, 18 Sep 2014 06:27:15 -0400 Original-Received: by mail-la0-f44.google.com with SMTP id q1so836230lam.17 for ; Thu, 18 Sep 2014 03:27:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=Bm9H6NOsyZWRMripJHO2Jns3nzg653EwjGYmHaZ42o0=; b=CMQV5hY9LCvS29wfc8R1V7LZfB8xpjf78KQ/jtGgdYM7JXOHyqoiQsvYUAsp2QniVy E6109SliyQYFRjfSLHLaO8QyIgilUyb3YFV2CrgBdRfnzcBGpyuX8eifDOkkJiKuSfNq BrmMzOHEcq1pS1kke/Or1HfcxcO9UV8IemC6AVhjU6hmpe/AAkP+oqUga9GeT+JAi3Rd eMx3pguf4PsiHMyionB5MUfSpBjgyYQYBFJAD01p6eo9jKNZP4fW6R4L/bTwwEoRV3U1 P/T7PDquQvAP3RvTdJyoUrVx2UZsLZLsv3iA5hnW0wDhT05ZGH0mE9nriuNi9Gvmul9E BSjA== X-Received: by 10.112.198.163 with SMTP id jd3mr3278706lbc.72.1411035608042; Thu, 18 Sep 2014 03:20:08 -0700 (PDT) Original-Received: from taylan.uni.cx (p200300514A48ABEE0213E8FFFEED36FB.dip0.t-ipconnect.de. [2003:51:4a48:abee:213:e8ff:feed:36fb]) by mx.google.com with ESMTPSA id z6sm6752110laj.31.2014.09.18.03.20.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Sep 2014 03:20:07 -0700 (PDT) In-Reply-To: <2097C007-9993-4AA1-A5F7-209A7DADD6CE@alumni.caltech.edu> (Matt Wette's message of "Wed, 17 Sep 2014 18:18:05 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22c 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:11528 Archived-At: Matt Wette writes: > 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 Hi Matt, I see your code is doing things like (format #t "~a\n" (define mt (make-tokiz "abc=def"))) The argument to `format' there is necessarily an "expression" in the grammar of Scheme. Definitions like (define ...) are not a valid type of expression in Scheme. The only places you can use definitions are - the top-level of a program/library - the *beginning* of a "code body" like the body of a `lambda', the body of a `let', etc. can have a sequence of definitions; the first non-definition expression terminates that sequence - when you have a (begin ...) form in a position where a definition would otherwise be allowed, then the body of this begin may also start with a series of definitions; again, the first non-definition expression terminates this sequence The following are examples of well-formed code: (define (foo) (define (helper1) ...) (define (helper2) ...) (do-something-with (helper1)) (do-something-with (helper2))) (let (...) (define (helper1) ...) ... (do-something-with (helper1))) (let (...) (begin (define (helper1) ...) (define (helper2) ...) (do-something-with (helper1))) (do-something-with (helper2))) The following are not well-formed: (define (foo) (do-something) (define (helper1) ...) (do-something-with (helper1))) ;; Because the helper1 definition is in the middle of the foo lambda ;; body, with a preceding non-definition expression. (let (...) (do-something) (begin (define (helper1) ...) (do-something-with (helper1))) (do-something) ;; Because the whole `begin' is in the middle of a let body, so the ;; begin may have no definitions at all. The begin is "in an expression ;; context". Hope that helps. Taylan