diff --git a/desktop/sources/scripts/lisp.js b/desktop/sources/scripts/lisp.js index 3077df4..19bab38 100644 --- a/desktop/sources/scripts/lisp.js +++ b/desktop/sources/scripts/lisp.js @@ -115,6 +115,8 @@ function Lisp (input, lib) { return { type: TYPES.number, value: parseFloat(input) } } else if (input[0] === '"' && input.slice(-1) === '"') { return { type: TYPES.string, value: input.slice(1, -1) } + } else if (input[0] === ':') { + return { type: TYPES.string, value: input.slice(1) } } else if (input === 'true' || input === 'false') { return { type: TYPES.bool, value: input === 'true' } } else { diff --git a/examples/objects.lisp b/examples/objects.lisp index 31e681c..e02eca0 100644 --- a/examples/objects.lisp +++ b/examples/objects.lisp @@ -1,11 +1,15 @@ ; objects -(def ob {"a" 1 "b" 2}) +(test "symbols" :a "a") -(echo (of ob "a")) +(def ob {:a "fantastic" :b 2}) + +((of (js) :console :log) ob) + +(echo (of ob :a)) (echo (keys ob)) (echo (values ob)) -(set ob "a" 4) -(echo (of ob "a")) \ No newline at end of file +(set ob :a 4) +(echo (of ob :a)) \ No newline at end of file