Mercurial Hosting > luan
changeset 1302:5345466fa61f
fix last commit and improve stringify
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 13 Jan 2019 17:28:57 -0700 |
parents | a9cc35c71eb0 |
children | 693da73c8a2f |
files | src/luan/modules/BasicLuan.java src/luan/modules/Thread.luan src/luan/modules/ThreadLuan.java |
diffstat | 3 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/luan/modules/BasicLuan.java Sun Jan 13 17:14:45 2019 -0700 +++ b/src/luan/modules/BasicLuan.java Sun Jan 13 17:28:57 2019 -0700 @@ -228,8 +228,15 @@ } } - public static String stringify(Object obj,Boolean strict) throws LuanException { - boolean b = strict!=null ? strict : false; + public static String stringify(Object obj,String strict) throws LuanException { + boolean b; + if( strict==null ) { + b = false; + } else if( strict.equals("strict") ) { + b = true; + } else { + throw new LuanException("strict must be nil or 'strict'"); + } return LuanToString.toString(obj,b); }
--- a/src/luan/modules/Thread.luan Sun Jan 13 17:14:45 2019 -0700 +++ b/src/luan/modules/Thread.luan Sun Jan 13 17:28:57 2019 -0700 @@ -30,7 +30,7 @@ function Thread.schedule(delay,fn,repeating) fn = safe(fn) - ThreadLuan.schedule(delay,fn,...) + ThreadLuan.schedule(delay,fn,repeating) end
--- a/src/luan/modules/ThreadLuan.java Sun Jan 13 17:14:45 2019 -0700 +++ b/src/luan/modules/ThreadLuan.java Sun Jan 13 17:28:57 2019 -0700 @@ -69,7 +69,7 @@ } else if( repeating.equals("at_fixed_rate") ) { sf = scheduler.scheduleAtFixedRate(r,delay,delay,TimeUnit.MILLISECONDS); } else { - throw new LuanException("repeat must be nil or 'with_fixed_delay' or 'at_fixed_rate'"); + throw new LuanException("repeating must be nil or 'with_fixed_delay' or 'at_fixed_rate'"); } final Closeable c = new Closeable(){public void close(){ boolean b = sf.cancel(false);