Skip to content

Instantly share code, notes, and snippets.

@hashmal
Created April 13, 2013 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hashmal/5379857 to your computer and use it in GitHub Desktop.
Save hashmal/5379857 to your computer and use it in GitHub Desktop.

In concatenative languages, any subexpression can be replaced with a name that represents the same subexpression.

Reserving operations in Shirka remove this property:

42 -> x   x   <- x      -- works

42 -> x [ x   <- x ] !  -- cannot undefine x

1 -> x   2 -> x   <- x  -- result is 2

1 -> x [ 2 -> x ] <- x  -- result is 1

Be careful when factoring!

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