diff --git a/src/cg/06-inspector.cg b/src/cg/06-inspector.cg index 82bd87b..c88b2a1 100644 --- a/src/cg/06-inspector.cg +++ b/src/cg/06-inspector.cg @@ -1,5 +1,5 @@ inspector = config \ - val = eval config.name; + val = eval! config.name; reflected = val | Value v \ reflect v diff --git a/src/cg/06-tree.cg b/src/cg/06-tree.cg index c327f85..504a059 100644 --- a/src/cg/06-tree.cg +++ b/src/cg/06-tree.cg @@ -75,7 +75,7 @@ treeNode = config \ isExp = contains config.path config.expanded; onSubmit = text \ ( - (eval text) + (eval! text) | Value v \ batch [rebindAt config.path v, config.onDoneEditing {}] | _ \ config.onDoneEditing {}); @@ -204,7 +204,7 @@ tree = config \ view = state emit \ onToggle = path \ emit (Toggle path); onEditLeaf = path \ - _ = debug "onEditLeaf" path; + _ = debug! "onEditLeaf" path; emit (EditLeaf path); onDoneEditing = _ \ emit DoneEditing; totalH = treeNodeHeight config.value config.path state.expanded; diff --git a/src/cg/10-os.cg b/src/cg/10-os.cg index 228bc62..ff43086 100644 --- a/src/cg/10-os.cg +++ b/src/cg/10-os.cg @@ -174,14 +174,14 @@ os = | None \ openWindow title content; onSelect = input \ - result = eval input; + result = eval! input; result | Defined name \ openOrFocus name (size \ inspector { name = name, w = size.w, h = size.h }) | Value v \ (getSource input == "" | True \ openOrFocus input (_ \ ui.text { content = show v, color = "white" }) | False \ openOrFocus input (size \ inspector { name = input, w = size.w, h = size.h })) - | Err msg \ (_ = debug "Error" msg; noOp); + | Err msg \ (_ = debug! "Error" msg; noOp); handleFocusLeftEvent = state \ newIndex = max 0 (osState.wm.focusedIndex - 1); diff --git a/src/runtime-js.ts b/src/runtime-js.ts index 1a77e67..e7e96b1 100644 --- a/src/runtime-js.ts +++ b/src/runtime-js.ts @@ -82,7 +82,7 @@ export const _rt = { join: (delim: string) => (xs: string[]) => xs.join(delim), split: (delim: string) => (xs: string) => xs.split(delim), slice: (s: string | any[]) => (start: number) => (end: number) => s.slice(start, end), - debug: (label: string) => (value: any) => { console.log(label, value); return value; }, + "debug!": (label: string) => (value: any) => { console.log(label, value); return value; }, fuzzyMatch: (query: string) => (target: string) => { const q = query.toLowerCase(); const t = target.toLowerCase(); @@ -101,7 +101,7 @@ export const _rt = { const printed = prettyPrint(ast); return printed; }, - saveImage: () => { + "saveImage!": () => { const saved: Record = {}; for (const [name, ast] of definitions) { const source = prettyPrint({ kind: 'definition', name, body: ast }); @@ -137,7 +137,7 @@ export const _rt = { return { _tag: 'Rebind', _0: name, _1: path, _2: value }; }, - undefine: (name: string) => { + "undefine": (name: string) => { delete store[name]; definitions.delete(name); dependencies.delete(name); @@ -171,7 +171,7 @@ export const _rt = { return { _tag: 'NoneValue' }; }, - eval: (code: string) => { + "eval!": (code: string) => { const trimmed = code.trim(); // is it a definition