From 48d491aa841c5689b1ccd76e1872ac638c6aa716 Mon Sep 17 00:00:00 2001 From: leaf corcoran Date: Sun, 20 Nov 2011 17:52:19 -0800 Subject: [PATCH] moon.p function and clean up todo --- moon/init.lua | 3 +++ moon/init.moon | 3 +++ todo | 19 +++---------------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/moon/init.lua b/moon/init.lua index b6178db..ba8f7a5 100644 --- a/moon/init.lua +++ b/moon/init.lua @@ -6,6 +6,9 @@ local lua = { debug = debug } dump = util.dump +p = function(...) + return print(dump(...)) +end debug = { upvalue = function(fn, k, v) local upvalues = { } diff --git a/moon/init.moon b/moon/init.moon index 84f496b..479b54b 100644 --- a/moon/init.moon +++ b/moon/init.moon @@ -10,6 +10,9 @@ export * dump = util.dump +p = (...) -> + print dump ... + debug = { upvalue: (fn, k, v) -> upvalues = {} diff --git a/todo b/todo index 8839e61..378d2ac 100644 --- a/todo +++ b/todo @@ -1,13 +1,13 @@ # TODO +-- seems like running in moon messes up require order + - don't reuse _, put a local on it, so we don't keep around trash -- swithc X with Func - or= and= -- move stuff out of format that should be in types - - a do block for making a quick anon func and calling it - error with stray comma at end of line @@ -15,9 +15,6 @@ - dump node in mark, see why values are being parsed multiple times -if hello else world - -> if hello then hello else world - - varargs that get put in a nested generated function aren't valid anymore: - class expressions, x = class extends Hello do new: => print "hello" @@ -31,18 +28,13 @@ if hello else world * elseif with value that inserts lines - need to decompose elif into if inside else -* export could also be used like so: - - export a = -> "hello" - -or +* export later? x = 232 export x * allow return anywhere in block -* upercase constants and capital letter variables should automatically be exported (in the global scope?) * any/every keywords for comprehensions? (what about iterators) @@ -51,10 +43,5 @@ not working right: double_args = (...) -> [x * 2 for x in *{...}] - -still some issues with whitespace at end of line - * let array items in table be defined without {} when indented -* key,value table comprehensions with { } -