Permalink
Browse files

Fixed nullary (there's a github issue related to this) to work with

2-ary functions.
  • Loading branch information...
1 parent 844dda6 commit ab4f6d55a1725cb0c2cacb54b97fe3b7cf16c8b1 @stevej committed Oct 11, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/Stackist/Interpreter1.hs
@@ -72,9 +72,9 @@ _dip (Quote q : m : xs) = r ++ (m : xs)
-- | [P] -> R Executes P, which leaves R on top of the stack. No matter
-- how many parameters this consumes, none are removed from the stack.
--
--- >>> redex [] [Quote [Numeric 1, Numeric 2, Literal "+"], Literal "nullary"]
--- [Numeric 3]
-_nullary (Quote q : xs) = (redex [] q) ++ xs
+-- >>> redex [] [Numeric 2, Quote [Numeric 1, Literal "+"], Literal "nullary"]
+-- [Numeric 3,Numeric 2]
+_nullary (Quote q : xs) = (redex xs q) ++ xs
-- | S T -> U Sequence U is the concatenation of sequences S and T.
--
@@ -96,6 +96,7 @@ _fold xs = redex xs [Literal "swapd", Literal "step"]
-- | swapd : X Y Z -> Y X Z
+-- FIXME: I don't know if I'm following this.
--
-- >>> redex [] [JString "a", JString "b", JString "c", Literal "swapd"]
-- [JString "c",JString "a",JString "b"]

0 comments on commit ab4f6d5

Please sign in to comment.