public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* The command line option --script
@ 2024-01-04  3:16 伊藤一光
  2024-01-04  5:46 ` Per Bothner
  0 siblings, 1 reply; 2+ messages in thread
From: 伊藤一光 @ 2024-01-04  3:16 UTC (permalink / raw)
  To: kawa

[-- Attachment #1: Type: text/plain, Size: 918 bytes --]

I remember reading some explanation about the command line option
"--script", but I do not fully understand it. Now I have got a script which
shows significantly different results depending on whether it is run with
or without "--script".  I would like to know how this happens.

Here is my test case.

$ java kawa.repl -e '(scheme-implementation-version)'
3.1.1 (git describe: 3.1.1-0-gc47de33ad)$
$ cat 0.scm
(include "01.scm")
(include "02.scm")
(display (format #f "~a ~a ~a ~%" a1 a2 aa))
$ cat 01.scm
;; This is 01.scm
(define aa '())

(define-syntax define-a
  (syntax-rules ()
    ((_ a p)
       (begin
          (define a p)
          (set! aa (cons a aa))))))
$ cat 02.scm
;; This is 02.scm
(define-a a1 1)
(define-a a2 2)
$ java kawa.repl 0.scm
1 2 (2 1)
$ java kawa.repl --script 0.scm
/home/kaz/02.scm:3:1: duplicate declaration of 'aa'
/home/kaz/02.scm:3:1: (this is the previous declaration of 'aa')
$

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-04  5:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-04  3:16 The command line option --script 伊藤一光
2024-01-04  5:46 ` Per Bothner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).