Skip to content

Instantly share code, notes, and snippets.

@Vaguery
Created July 24, 2010 14:50
Show Gist options
  • Select an option

  • Save Vaguery/488733 to your computer and use it in GitHub Desktop.

Select an option

Save Vaguery/488733 to your computer and use it in GitHub Desktop.
block {
block {
ref x
ref x
value «proportion»
ref x
do int_multiply }
block {
block {
ref x
do int_add
block {
do int_add
ref x
do int_add
value «bool» }
do bool_not
ref x }
ref x
do int_add
ref x
block {
do bool_and
block {
do bool_not
do int_add
do bool_or
do int_add
value «int» }
do int_subtract
value «bool»
block {
do int_greater_than <= there's the culprit; not sure why it fails this way though
do int_abs } } }
ref x
ref x
ref x}
\n«proportion»0.578693542001044\n«bool»false\n«int»-4\n«bool»true
@Vaguery
Copy link
Copy Markdown
Author

Vaguery commented Jul 24, 2010

If you load this into the current version of the Nudge interpreter and run it, say with x bound to
Value.new(:int, 100)
and run it, you will not find three copies of "100" on the top of the :int stack as you should. Weird thing is, if you just run
block { ref x ref x ref x}
you will. So... what's happening?

@Vaguery
Copy link
Copy Markdown
Author

Vaguery commented Jul 24, 2010

So the immediate cause is the appearance of "int_greater_than" in the code. Still digging upstream to see how that breaks the program, which it shouldn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment