Leaking definitions #23

Closed
mwatts15 opened this Issue Nov 28, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@mwatts15
Owner

mwatts15 commented Nov 28, 2012

Definitions are being lost during interpretation:

(markw@envy)(zsh:2)(/v/filer4b/v38q001/markw/cs345/proj/crono)
(1160)% ./crono.sh -T                                                                                        23:38
Crono++ by Mark Watts, Carlo Vidal, Troy Varney (c) 2012

> (load "prelude.lisp")
Visiting (load prelude.lisp)
  Visiting load
    Result: load
  Visiting prelude.lisp
    Result: prelude.lisp
  Result: #t
Result: #t
> (prFoldr + 1 '(1 2 3))
Visiting (prFoldr + 1 '(1 2 3))
  Visiting prFoldr
    Result: (\ (fn z x) (<Y> (<B> (<COND> (= Nil) (<K> z)) (<B> (<S> (<B> fn (car))) (<C> <B> cdr))) x))
  Visiting +
    Result: +
  Visiting 1
    Result: 1
  Visiting '(1 2 3)
  Visiting (1 2 3)
    Result: (1 2 3)
    Result: (1 2 3)
Invalid Function Application: g is not a function in (g x)
vvvvvvvvvHEREvvvvvvvvvv
> (prFoldr + 1 '(1 2 3))
Invalid Function Application: prFoldr is not a function in (prFoldr + 1 '(1 2 3))
^^^^^^^^^^^^^^^^^^^^^^^^^
> 

and even more disturbing

> (+ 2 3)
Result: (+ 2 3)
> (+ 2 3 4)
Too many arguments to +: 3/2 recieved
> (+ 2 3)
Result: (+ 2 3)
>

First guess is unmatched push/popEnv()

@mwatts15

This comment has been minimized.

Show comment Hide comment
@mwatts15

mwatts15 Nov 28, 2012

Owner

Tracing environment pushes and pops doesn't reveal anything.

Owner

mwatts15 commented Nov 28, 2012

Tracing environment pushes and pops doesn't reveal anything.

@tvarney

This comment has been minimized.

Show comment Hide comment
@tvarney

tvarney Nov 28, 2012

Collaborator

It's probably because the interpreter doesn't reset any modified options when throwing an exception. EvalType is the offender in this case.

Collaborator

tvarney commented Nov 28, 2012

It's probably because the interpreter doesn't reset any modified options when throwing an exception. EvalType is the offender in this case.

@tvarney

This comment has been minimized.

Show comment Hide comment
@tvarney

tvarney Nov 28, 2012

Collaborator

Yep, adding a line to set the eval variable back to it's saved value fixed this. Closing.

Collaborator

tvarney commented Nov 28, 2012

Yep, adding a line to set the eval variable back to it's saved value fixed this. Closing.

@tvarney tvarney closed this Nov 28, 2012

tvarney pushed a commit that referenced this issue Nov 28, 2012

Troy Varney
Fixed Issue #23. Interpreter now correctly resets state when throwing an
exception. Also fixed trace messages using toString instead of repr.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment