BAM Weblog

Roy - REPL Improvements

Brian McKenna2012-02-12

I've added a few improvements to the Roy REPL.

You can now see the type of assigned identifiers with the :t directive:

roy> let x = 100
roy> :t x
Number
roy> let a = [1, 2, 3]
roy> :t a
[Number]

A structure's values are printed instead of [object Object]:

roy> let x = {a: 1, b: true, c: "three"}
roy> x
{"a":1,"b":true,"c":"three"} : {a: Number, b: Boolean, c: String}

A helpful message is now shown when the lexer fails:

roy> can't lex this
Couldn't tokenise: 't lex this

And you can choose not to include the prelude when running files:

$ ./roy -p examples/option.roy 
{ _0: 6 }

Hopefully this will make the REPL experience a bit nicer.

Please enable JavaScript to view the comments powered by Disqus.