Skip to content
This repository has been archived by the owner on Oct 10, 2021. It is now read-only.

Order of definitions in REPL #20

Closed
hyln9 opened this issue Sep 12, 2014 · 6 comments
Closed

Order of definitions in REPL #20

hyln9 opened this issue Sep 12, 2014 · 6 comments
Labels

Comments

@hyln9
Copy link
Owner

hyln9 commented Sep 12, 2014

Definitions that call functions defined later in the file don't seem to be handled as I would expect when loaded at the REPL. When run as a script, they work as I expect. For example:

jnear@sandstone r6mk $ cat test.scm

!/usr/bin/env scheme-script

(import (rnrs))

(define foo
(lambda ()
(bar)))

(define bar
(lambda ()
(display "bar!")
(newline)))

(foo)
jnear@sandstone r6mk $ ikarus --r6rs-script test.scm
bar!
jnear@sandstone r6mk $ ikarus test.scm
Ikarus Scheme version 0.0.3+ (revision 1477, build 2008-05-13)
Copyright (c) 2006-2008 Abdulaziz Ghuloum

Unhandled exception:
Condition components:

  1. &assertion
  2. &who: eval
  3. &message: "unbound variable"
  4. &irritants: (bar)

Launchpad Details: #LP230395 Joe Near - 2008-05-14 13:29:27 -0400

@hyln9 hyln9 added the high label Sep 12, 2014
@hyln9
Copy link
Owner Author

hyln9 commented Sep 12, 2014

You can always just start the REPL and call (load "test.scm") (or (include "test.scm")).

Launchpad Details: #LPC leppie - 2008-05-14 13:48:35 -0400

@hyln9
Copy link
Owner Author

hyln9 commented Sep 12, 2014

I noticed this yesterday and was going to report it, but you raced me to it. Thanks.

Launchpad Details: #LPC Abdulaziz Ghuloum - 2008-05-14 21:46:59 -0400

@hyln9
Copy link
Owner Author

hyln9 commented Sep 12, 2014

How exactly does it work? It starts the REPL and then do a load/include on the filename(s) passed as parameters? How do you pass additional parameters/files?

Launchpad Details: #LPC leppie - 2008-05-15 09:37:08 -0400

@hyln9
Copy link
Owner Author

hyln9 commented Sep 12, 2014

Fixed in 1478. Let me know if that messed up something else.

Launchpad Details: #LPC Abdulaziz Ghuloum - 2008-05-15 09:41:49 -0400

@hyln9
Copy link
Owner Author

hyln9 commented Sep 12, 2014

On May 15, 2008, at 6:37 AM, leppie wrote:

How exactly does it work? It starts the REPL and then do a load/
include
on the filename(s) passed as parameters? How do you pass additional
parameters/files?

When you start "ikarus file1 file2 file3 ...", the contents of the
files will be evaled one by one before the repl prompt comes up.

Launchpad Details: #LPC Abdulaziz Ghuloum - 2008-05-15 09:49:47 -0400

@hyln9
Copy link
Owner Author

hyln9 commented Sep 12, 2014

Thanks :)

So it is effectively:

ikarus

(include file1)
(include file2)
(include file3)
...
; this is where we end

?

Launchpad Details: #LPC leppie - 2008-05-15 10:33:41 -0400

@hyln9 hyln9 closed this as completed Sep 12, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant