Add do_call macro, implement Bool builtins, add tests
* I noticed that `fn call(...)` in all objects was identical, so I made a macro for it. This should make things a little easier to read, since do_call is about 30 lines a pop. * Bool has a constructor now, and a to_int and to_float implementations * Add tests for constructors and add new bool tests Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -33,8 +33,17 @@ println(a + a)
|
||||
println(a + a + a)
|
||||
println(a + b)
|
||||
println(b + a)
|
||||
|
||||
# __mul__
|
||||
println("__mul__")
|
||||
println(a * 4)
|
||||
println(b * 5)
|
||||
println((a * 6).to_repr())
|
||||
|
||||
# constructor
|
||||
println("constructor")
|
||||
println(Str("asdf"))
|
||||
println(Str(1234))
|
||||
println(Str(1.0))
|
||||
println(Str(true))
|
||||
println(Str(false))
|
||||
|
||||
Reference in New Issue
Block a user