diff --git a/spl/std.spl b/spl/std.spl index 3b516a5..152633f 100644 --- a/spl/std.spl +++ b/spl/std.spl @@ -648,7 +648,10 @@ func times { | with amount callable ; } func check-match { bool | with input output ; - output gettype "func" eq input null eq not and if { + input null eq if { + 0 2 stop + } + output gettype "func" eq if { 1 2 stop } input output eq if { @@ -686,7 +689,10 @@ func match-unchecked { | with input output ; } func match { bool | with input output ; - output gettype "func" eq input null eq not and if { + input null eq if { + 0 2 stop + } + output gettype "func" eq if { input output call 1 2 stop } diff --git a/src/lexer.rs b/src/lexer.rs index dbb494a..9ac1f49 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -138,7 +138,7 @@ fn read_block_dyn( run_as_base: false, })))) } - x if x.len() >= 2 && &x[0..2] == "!{" => { + x if x.len() >= 2 && x.get(0..2) == Some("!{") => { words.push(Word::Const(Value::Str(x[2..].to_owned()))); } "<" => {