From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68034 invoked by alias); 11 Jun 2017 22:37:07 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 68010 invoked by uid 89); 11 Jun 2017 22:37:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=transformer, threw, H*x:1.6, H*UA:1.6 X-HELO: homiemail-a76.g.dreamhost.com Received: from sub3.mail.dreamhost.com (HELO homiemail-a76.g.dreamhost.com) (69.163.253.7) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 11 Jun 2017 22:37:04 +0000 Received: from homiemail-a76.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTP id AEA0E45807B for ; Sun, 11 Jun 2017 15:37:07 -0700 (PDT) Received: from vereq.eip10.org (cpe-74-75-122-130.maine.res.rr.com [74.75.122.130]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: chaw@eip10.org) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTPSA id 8529B458079 for ; Sun, 11 Jun 2017 15:37:07 -0700 (PDT) Received: from chaw by vereq.eip10.org with local (Exim 4.84_2) (envelope-from ) id 1dKBTm-0002uN-6Q for kawa@sourceware.org; Sun, 11 Jun 2017 18:37:06 -0400 To: kawa Subject: Exception on pprint-logical-block without 'out:' (patch incl.) From: "Sudarshan S Chawathe" Reply-To: "Sudarshan S Chawathe" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Sun, 11 Jun 2017 22:37:00 -0000 Message-ID: <11182.1497220626@vereq.eip10.org> X-IsSubscribed: yes X-SW-Source: 2017-q2/txt/msg00105.txt.bz2 --=-=-= Content-Type: text/plain Content-length: 1965 Evaluating a pprint-logical-block form without the optional 'out' keyword argument throws an exception. (See details below.) It works fine when that is provided. Based on a quick look at kawa/lib/kawa/pprint.scm, I suspect the problem is just a missing (define out-expr #!null) in the define-syntax-case. The attached trivial patch seems to do the trick, but I have not tested carefully. (I can also submit using gitlab if you prefer.) Details: chaw@vereq:~$ kawa #|kawa:1|# (import (kawa pprint)) #|kawa:2|# (pprint-logical-block (display 'ok)) /dev/stdin:2:1: evaluating syntax transformer 'pprint-logical-block' threw kawa/pprint.scm:69:30: unbound location: out-expr gnu.mapping.DynamicLocation.get(DynamicLocation.java:36) kawa.lib.kawa.pprint.lambda1(pprint.scm:69) kawa.lib.kawa.pprint.lambda1$check(pprint.scm:10000) gnu.mapping.CallContext.runUntilValue(CallContext.java:667) gnu.mapping.Procedure.apply1(Procedure.java:148) kawa.lang.Macro.expand(Macro.java:205) kawa.lang.Macro.scanForm(Macro.java:235) kawa.lang.Translator.scanForm(Translator.java:1621) gnu.kawa.lispexpr.LispLanguage.parse(LispLanguage.java:117) gnu.expr.Language.parse(Language.java:764) gnu.expr.Language.parse(Language.java:758) kawa.Shell.run(Shell.java:266) kawa.Shell.run(Shell.java:196) kawa.Shell.run(Shell.java:183) kawa.repl.processArgs(repl.java:714) kawa.repl.main(repl.java:820) #|kawa:3|# (pprint-logical-block out: (current-output-port) (display 'ok)) ok #|kawa:4|# chaw@vereq:~$ kawa --version Kawa 2.93 (git describe: 2.93-23-g4fa24f2-dirty) Copyright (C) 2017 Per Bothner chaw@vereq:~$ java -version openjdk version "1.8.0_131" OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-1~bpo8+1-b11) OpenJDK Server VM (build 25.131-b11, mixed mode) chaw@vereq:~$ uname -a Linux vereq.eip10.org 3.16.0-4-686-pae #1 SMP Debian 3.16.43-2 (2017-04-30) i686 GNU/Linux chaw@vereq:~$ Regards, -chaw --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=kawa-pprint-out.patch Content-length: 406 diff --git a/kawa/lib/kawa/pprint.scm b/kawa/lib/kawa/pprint.scm index 2da844c..d402051 100644 --- a/kawa/lib/kawa/pprint.scm +++ b/kawa/lib/kawa/pprint.scm @@ -38,6 +38,7 @@ (define per-line-prefix-expr #!null) (define suffix-expr #!null) (define port-expr #!null) + (define out-expr #!null) (let loop ((rest #'body)) (syntax-case rest () ((prefix: sexp . r) --=-=-=--