Compare commits
2 Commits
45d999d32e
...
a534e241f9
Author | SHA1 | Date | |
---|---|---|---|
|
a534e241f9 | ||
|
a5e1aad83d |
|
@ -920,7 +920,7 @@ fn get {
|
||||||
fn update {
|
fn update {
|
||||||
"Takes a dict, key, and function, and returns a new dict with the key set to the result of applying the function to original value held at the key."
|
"Takes a dict, key, and function, and returns a new dict with the key set to the result of applying the function to original value held at the key."
|
||||||
(d as :dict) -> d
|
(d as :dict) -> d
|
||||||
(d as :dict, k as :keyword, updater as :fn) -> assoc (d, k, updater (get (k, d)))
|
(d as :dict, k as :keyword, updater as :fn) -> assoc (d, k, updater (get (d, k)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn keys {
|
fn keys {
|
||||||
|
@ -974,7 +974,7 @@ fn random {
|
||||||
}
|
}
|
||||||
(d as :dict) -> {
|
(d as :dict) -> {
|
||||||
let key = do d > keys > random
|
let key = do d > keys > random
|
||||||
get (key, d)
|
get (d, key)
|
||||||
}
|
}
|
||||||
& (s as :set) -> do s > list > random
|
& (s as :set) -> do s > list > random
|
||||||
}
|
}
|
||||||
|
|
|
@ -403,7 +403,7 @@ function __wbg_get_imports() {
|
||||||
_assertBoolean(ret);
|
_assertBoolean(ret);
|
||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
imports.wbg.__wbindgen_closure_wrapper8169 = function() { return logError(function (arg0, arg1, arg2) {
|
imports.wbg.__wbindgen_closure_wrapper8189 = function() { return logError(function (arg0, arg1, arg2) {
|
||||||
const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_20);
|
const ret = makeMutClosure(arg0, arg1, 363, __wbg_adapter_20);
|
||||||
return ret;
|
return ret;
|
||||||
}, arguments) };
|
}, arguments) };
|
||||||
|
|
Binary file not shown.
|
@ -156,7 +156,7 @@ fn traceback(panic: &Panic) -> String {
|
||||||
fn frame_info(frame: &CallFrame) -> String {
|
fn frame_info(frame: &CallFrame) -> String {
|
||||||
let span = frame.chunk().spans[if frame.ip == 0 { 0 } else { frame.ip - 1 }];
|
let span = frame.chunk().spans[if frame.ip == 0 { 0 } else { frame.ip - 1 }];
|
||||||
let line_number = line_number(frame.chunk().src, span);
|
let line_number = line_number(frame.chunk().src, span);
|
||||||
console_log!("ip: {} | span: {span} | line: {line_number}", frame.ip);
|
// console_log!("ip: {} | span: {span} | line: {line_number}", frame.ip);
|
||||||
let line = get_line(frame.chunk().src, line_number);
|
let line = get_line(frame.chunk().src, line_number);
|
||||||
let line = line.trim_start();
|
let line = line.trim_start();
|
||||||
let name = frame.function.as_fn().name();
|
let name = frame.function.as_fn().name();
|
||||||
|
|
|
@ -40,7 +40,13 @@ impl LFn {
|
||||||
pub fn patterns(&self) -> Value {
|
pub fn patterns(&self) -> Value {
|
||||||
match self {
|
match self {
|
||||||
LFn::Declared { .. } => unreachable!(),
|
LFn::Declared { .. } => unreachable!(),
|
||||||
LFn::Defined { patterns, .. } => Value::from_string(patterns.join(" | ")),
|
LFn::Defined { patterns, .. } => Value::from_string(
|
||||||
|
patterns
|
||||||
|
.iter()
|
||||||
|
.map(|pattern| format!(" {pattern}"))
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join("\n"),
|
||||||
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user