diff --git a/app/elm/StandardLibrary.elm b/app/elm/StandardLibrary.elm index 21eac40..5989dca 100644 --- a/app/elm/StandardLibrary.elm +++ b/app/elm/StandardLibrary.elm @@ -14,6 +14,7 @@ The only thing omitted so far are the calls to `bury` because burying is not yet implemented in elm-logo. [combine]: https://github.com/jrincayc/ucblogo-code/blob/master/logolib/combine +[queue]: https://github.com/jrincayc/ucblogo-code/blob/master/logolib/queue [reverse]: https://github.com/jrincayc/ucblogo-code/blob/master/logolib/reverse -} @@ -24,6 +25,10 @@ if wordp :those [output word :this :those] output fput :this :those end +to queue :the.queue.name :the.item.value +make :the.queue.name lput :the.item.value thing :the.queue.name +end + to reverse :in [:out ifelse listp :in [[]] ["]] if emptyp :in [output :out] output (reverse bf :in combine first :in :out) diff --git a/tests/Test/Run/StandardLibrary.elm b/tests/Test/Run/StandardLibrary.elm index e1621b8..7bbc4d4 100644 --- a/tests/Test/Run/StandardLibrary.elm +++ b/tests/Test/Run/StandardLibrary.elm @@ -13,6 +13,9 @@ functions = , printsLine "print combine \"a [b [c]]" "a b [c]" , printsLine "print combine [a] [b c]" "[a] b c" ] + , describe "queue" <| + [ printsLine "make \"q [] queue \"q 1 queue \"q [2] print :q" "1 [2]" + ] , describe "reverse" <| [ printsLine "print reverse [a b c d]" "d c b a" , printsLine "print reverse \"word" "drow"