From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 944 invoked by alias); 13 May 2014 08:02:21 -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 935 invoked by uid 89); 13 May 2014 08:02:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: st11p02mm-asmtp001.mac.com Received: from st11p02mm-asmtpout001.mac.com (HELO st11p02mm-asmtp001.mac.com) (17.172.220.236) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 May 2014 08:02:19 +0000 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from [192.168.1.75] (99-3-56-155.lightspeed.fyvlar.sbcglobal.net [99.3.56.155]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7u4-27.08(7.0.4.27.7) 64bit (built Aug 22 2013)) with ESMTPSA id <0N5I0041N6B6UY80@st11p02mm-asmtp001.mac.com> for kawa@sourceware.org; Tue, 13 May 2014 08:01:58 +0000 (GMT) Subject: Re: the right way to compile and load modules From: mikel evins In-reply-to: <5371CFD0.7070708@bothner.com> Date: Tue, 13 May 2014 08:02:00 -0000 Cc: mikel evins , kawa@sourceware.org Message-id: <7D1A5D60-5997-4B7A-9176-8F6FA315F016@me.com> References: <9F312D97-98C6-4F47-BDD9-B6CAF3868A28@me.com> <5371CFD0.7070708@bothner.com> To: Per Bothner X-MANTSH: 1TEIXWV4bG1oaGkdHB0lGUkdDRl5PWBoaGBEKTEMXGx0EGx0YBBIZBBsTEBseGh8 aEQpYTRdLEQptfhcaEQpMWRcbGhsbEQpZSRcRClleF2hjeREKQ04XSxseGmJCH2luGlxlGXhzB x5uGhIaG10RClhcFxkEGgQbGwdNTh8YGBgZSwUbHQQbHRgEEhkEGxMQGx4aHxsRCl5ZF2FaGXN 4EQpMRhdia2sRCkNaFxMTBBkEHxwEGx8fEQpEWBcZEQpESRcYEQpCRRdrE18fXUBPGWxkWhEKQ k4XbHBgeUAdYlJpGmIRCkJMF2ZhelthbWhSXl5gEQpCbBdkS3lEcwFDHR0aHxEKQkAXY2FnBUR DZGBJU1MRCnBoF2N/BXhiZn9IW2d9EQpwaBdnY1pMSXh8TGRkZBEKcGgXYQFEfWNlHFJbXF4RC nBoF2NzWAVCEhl/XHxuEQpwaBdocExtXnhIRB1TcBEKcGwXb0FJAWl+cBNeEm4RCnBMF3pAbVh zGmIbTW1JEQ== X-CLX-Spam: false X-CLX-Score: 1011 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.96,1.0.14,0.0.0000 definitions=2014-05-13_02:2014-05-13,2014-05-13,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1405130104 X-IsSubscribed: yes X-SW-Source: 2014-q2/txt/msg00045.txt.bz2 On May 13, 2014, at 2:54 AM, Per Bothner wrote: > On 05/12/2014 09:09 PM, mikel evins wrote: >> Okay, so I add a module-export form to bar.scm and recompile. >> Now foo.class runs as expected, but there's a new problem: if I load bar.scm, kawa complains that bar is exported but never defined. > > A possible problem is that load is line-by-line, which is fundamentally > incompatible with modules as a unit - and thus with export. If you use > load, leave off the exports. If I leave off the exports I cannot compile. I can try requiring or importing from the repl and see how that works. > Better to always use require (or r7rs import). You can use require to > import a source file (though you can't yet use import for that). > I don't have an example - it late, I'm tired, and my initial experiment > is doing something weird. :-( Another point: I was using parameters for certain things, but getting null pointer exceptions when referencing them in compiled code. I'm guessing that the compiled modules did not execute the toplevel defines that should have defined the parameters. I suppose that might reasonbly be an expected result, though it's a little inconvenient.