From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89200 invoked by alias); 22 Nov 2017 22:33:30 -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 86295 invoked by uid 89); 22 Nov 2017 22:33:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=BAYES_00,KB_WAM_FROM_NAME_SINGLEWORD,SPF_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*Ad:U*kawa, H*r:sk:kawa@so, H*M:int, UD:jar X-HELO: mail.io7m.com Received: from mail.io7m.com (HELO mail.io7m.com) (45.77.76.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Nov 2017 22:33:23 +0000 Received: from copperhead.int.arc7.info (unknown [IPv6:2a02:390:7502:2:0:2:1:0]) by mail.io7m.com (Postfix) with ESMTPSA id 5BB6A6398 for ; Wed, 22 Nov 2017 22:33:21 +0000 (UTC) Date: Wed, 22 Nov 2017 22:33:00 -0000 From: Mark Raynsford To: kawa@sourceware.org Subject: Difference in define behaviour between kawa.jar and embedded Scheme example Message-ID: <20171122223308.6b39e57d@copperhead.int.arc7.info> OpenPGP: id=8168DAE22B15D3EDC722C23D0F15B7D06FA80CB8; url=http://io7m.com/pgp/8168_DAE2_2B15_D3ED_C722_C23D_0F15_B7D0_6FA8_0CB8.key MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/KwJVONQsRG/r2hcoivBEqEg"; protocol="application/pgp-signature" X-IsSubscribed: yes X-SW-Source: 2017-q4/txt/msg00039.txt.bz2 --Sig_/KwJVONQsRG/r2hcoivBEqEg Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-length: 983 I have the following trivial example: https://raw.githubusercontent.com/io7m/kawa-experiments/develop/src/main/re= sources/com/io7m/kawa_exp/demo0.scm If I evaluate it on the command line: $ java -jar kawa-3.0/lib/kawa.jar #|kawa:1|# (define (six0 x) (+ 3 3)) #|kawa:2|# (define (+ x y) (* x y)) #|kawa:3|# (define (six1 x) (+ 3 3)) #|kawa:4|# (six0 0) 6 #|kawa:5|# (six1 0) 9 This is the behaviour I'd expect. If I then try (what appears to be) the same thing from Java: https://raw.githubusercontent.com/io7m/kawa-experiments/develop/src/main/ja= va/com/io7m/kawa_exp/SchemeExp0.java The program prints: 22:30:02.499 [main] DEBUG com.io7m.kawa_exp.SchemeExp0 - result: 9, 9 In other words, the redefinition of + on the second line is affecting the existing definition of six0 so that the applications of six0 and six1 are both returning 9. What's going on here? This is an unmodified kawa jar from the 3.0 binary distribution. --=20 Mark Raynsford | http://www.io7m.com --Sig_/KwJVONQsRG/r2hcoivBEqEg Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEgWja4isV0+3HIsI9DxW30G+oDLgFAloV+yUACgkQDxW30G+o DLiZiQ/+NnJ7iZkVzzzBnC0F4gCPPUJ3+BEa+bVsEwN2CZ/v8LZPpyJAIDBHF8gn MzjAwV9nwCVjcMAEkXtxGDDcc/z8DkoZzFj+oZxDpPmIkKXsdKzHgEU/N1bb8/2K HdYk26lNjoWt38C14YggnB/KM/4yU90P/ZSXW/iYI4OIrgzJPFsLK4b/C0WPQJjw DhV7lnRUwPvUcu5RMhBOPI4aMrYHkP3n38pqsV2EhqbHLFqxUGbyNl43/2Fsj0pX 6AC4OkgEu+K6XH20QNGh+JimeC8p4PhQE3Fc8vVFOCXvkUrWPFBq1UKTtYxMkb4c 7DmXHjTr1P03ntgh4QCduAE5ed7PebFlPpPpDA52DvfyhuKGuFNRBMSeEAQ/ybHi MFKqEW2QAeuAkpGGxWmQTFtjILVXzZNaTFqBS5RX8Xc0fM+IVM+VBrFILNHzoarE Y59GkzVZh/zEOaSbTysSJtlQUYIO0vkgJxDISzSYqT7qsLfHu0Tz7/xnqQcR7TTQ 2mZ+wi+qmE0H+5+H+3vi4UOMnbqLhWPKam4FYjksWY3BqcJyiJiweMWSXBHTI38R H0uPIw83nRfaOvrTCBMzBENYfNVz6sLDu+32h5AnfFtwnbOpBxhLSjeq8GcQxL0s T0uN1RbM08+aKpzEP5lLIvsTedfLNSR0iKeUP7d5GTlPHCoxHRc= =6BRN -----END PGP SIGNATURE----- --Sig_/KwJVONQsRG/r2hcoivBEqEg--