Sage Vaillancourt
85fb91b4ed
Use stripped Objects in hash.c
...
These lack the unused .forward field, reducing table memory by ~25%.
Also bump Object.number up to a long, and add a generic Object.data field.
2022-04-08 11:49:14 -04:00
Sage Vaillancourt
13d1168401
Wire up basic readline history/completion.
2022-04-08 10:23:12 -04:00
Sage Vaillancourt
056ea9eb13
Implement simple fn docstrings.
...
Adds usage of this new feature for pebblisp.pbl's (alias).
2022-04-08 00:36:12 -04:00
Sage Vaillancourt
9abec12d99
Implement loadfile in lib.pbl
2022-04-08 00:01:58 -04:00
Sage Vaillancourt
a2b0e0813b
Have `?` fall back to stringObj.
...
Note that ->forward is not used once an Object is in the environment.
2022-04-07 23:56:03 -04:00
Sage Vaillancourt
03d3247be3
Clean us tests.sh
...
Use EDITOR in pebblisp.pbl config alias.
Toying with a promptUpdater function.
2022-04-07 16:43:05 -04:00
Sage Vaillancourt
6f82567e41
No special handling for math operator tokens.
2022-04-07 14:29:35 -04:00
Sage Vaillancourt
7a0433aa68
Add funcyEval() for equivalent Func/Lambda eval.
...
Still a bit buggy.
Some general renaming for clarification.
2022-04-07 01:20:59 -04:00
Sage Vaillancourt
4baf7e011b
Handle all HASHLESS details in hash.c
2022-04-06 20:12:26 -04:00
Sage Vaillancourt
4d215b1b79
Add simple sigint handler for repl.
...
inline evalLambdaArgs() and evalBuiltIns()
2022-04-06 16:55:49 -04:00
Sage Vaillancourt
abaf3a1ddc
Use plfunc name in type-error messages.
...
Previously used the name of the C function.
2022-04-06 09:55:31 -04:00
Sage Vaillancourt
deca6045ff
More useful type-error messages.
...
BAD_PARAMS_ON -> BAD_PARAMS
Replace printType() with getTypeName().
Use --ignore-config in testing.
Add type-checking (and missing clone) to (await).
2022-04-06 09:51:53 -04:00
Sage Vaillancourt
99a9b9a2b6
Make threading tests more brief.
2022-04-06 00:05:30 -04:00
Sage Vaillancourt
67691e36bc
Fix Promise env longevity.
2022-04-06 00:03:34 -04:00
Sage Vaillancourt
b54b93c7d1
Add simple Promise type.
...
A bit unstable. Almost certainly needs some locking on struct Promise fields.
2022-04-05 23:53:17 -04:00
Sage Vaillancourt
fc4f0bef28
Move main() etc. into main.c
2022-04-05 20:05:58 -04:00
Sage Vaillancourt
5ca9fdb042
Tweak (penv) formatting.
...
Remove unused include from hash.c
2022-04-05 16:53:21 -04:00
Sage Vaillancourt
61b9f79c36
Pull segfault-handling into a dedicated function and ifdef.
...
Some stringing tweaks.
2022-04-05 16:41:23 -04:00
Sage Vaillancourt
b419826b8e
More robust addToTable().
...
Add several pl string functions: `slen`, `chars`, `matches`, and `substr`.
Add support for comments in native tests.
2022-04-05 15:30:30 -04:00
Sage Vaillancourt
eb2dde72e3
Small envForLambda() fix.
...
All tests are passing now, though there may still be a small leak.
2022-04-04 21:08:18 -04:00
Sage Vaillancourt
caaa6c53f6
Add simple object hashtable for env.
...
Currently has some issues with accessing parameters in recursive calls.
2022-04-04 14:15:44 -04:00
=
d625944e8d
Fixes to run on Pebble hardware.
...
Correct cloneObject(TYPE_OTHER) behavior.
2022-04-04 00:17:02 +01:00
=
343568afda
Merge branch 'master' of https://gitlab.com/sagev9000/pebblisp
2022-04-02 11:51:58 +01:00
=
323b3113d7
Patch to compile for Pebble devices.
...
Mostly throwing ifdef Standalone all over the place.
2022-04-02 11:51:06 +01:00
Sage Vaillancourt
13fa4ce54f
More cd-related sugar.
...
Add preprocess pl func for repl.
Add basic aliases to repl.
2022-04-02 04:57:53 -04:00
Sage Vaillancourt
1a13fe4814
Add `unused` macro.
...
Prefer malloc() over calloc() in env.c
2022-04-01 15:07:19 -04:00
Sage Vaillancourt
980a1c42ab
Add (cd) and (cwd).
...
Handle quotes in printColored().
2022-03-31 21:31:24 -04:00
Sage Vaillancourt
b770a618e0
Simpler listEvalFunc() implementation.
...
Simpler simpleFuncEval(), which should eventually be removed, anyway.
- Something with it or (reduce) is a bit leaky, but actually less so than before.
Small plfunc.c reordering.
2022-03-31 15:44:18 -04:00
Sage Vaillancourt
2fb6643326
A bit of cleanup and warning-hushing.
2022-03-31 14:12:52 -04:00
Sage Vaillancourt
ac04fa1a96
Make pointer-printing in (penv) optional.
...
Colorize (penv) output.
2022-03-31 13:23:45 -04:00
Sage Vaillancourt
fb2e1811ff
Rename possessive to structAccess.
...
Gives better error messages.
Use typical type-checking in structAccess.
Make checkTypes() more global, and move to pebblisp.c
2022-03-31 12:09:23 -04:00
Sage Vaillancourt
d2a0abeff3
Cleaner and more optimized (cat) implementation.
...
stringObj() will now _add_ to its length parameter.
More global scalloc and smalloc.
Bit of Makefile re-org.
2022-03-31 11:41:08 -04:00
Sage Vaillancourt
32e21bf758
Replace (struct's field) with (struct.field)
...
It was cute, but hard to read in space-delimited lists.
Convert (map) to a normal pl function.
Add trueObject() falseObject() macros.
2022-03-31 10:29:10 -04:00
Sage Vaillancourt
b4e0f57029
Use (env "HOME") in pebblisp.pbl for reload.
...
Show current working directory in prompt.
2022-03-30 16:59:05 -04:00
Sage Vaillancourt
b5f6a7d951
Add more colors to pebblisp.pbl
...
Plus a type comment on (time)
2022-03-30 16:54:17 -04:00
Sage Vaillancourt
f2742e8411
Add (env var_name)
...
Add make: release
2022-03-30 16:47:54 -04:00
Sage Vaillancourt
d76e3f5341
Make (def) a normal function.
...
Remove (defe) for now.
2022-03-30 16:32:42 -04:00
Sage Vaillancourt
342eba3a0d
Add basic (time) function and Time struct.
...
Also add pebblisp.pbl config file to examples/
2022-03-30 16:04:30 -04:00
Sage Vaillancourt
75ba0ac5ee
Dedicated getPrompt() function.
...
Can now handle strings or lambdas.
2022-03-30 14:41:53 -04:00
Sage Vaillancourt
92daee1d0d
Skip past func-y objects in REPL, too.
2022-03-29 23:01:50 -04:00
Sage Vaillancourt
f48e1bf5c9
REPL defers to sh when a symbol isn't found.
2022-03-29 22:51:13 -04:00
Sage Vaillancourt
85d8ee73e7
Add docs/tests to the old BASIC_OP functions.
...
Also test `poss`.
2022-03-29 20:00:57 -04:00
Sage Vaillancourt
5779ad5427
Define function symbols at their declaration.
2022-03-29 19:00:01 -04:00
Sage Vaillancourt
52c928846d
Fix `rf` string-offsetting bug.
2022-03-29 16:57:59 -04:00
Sage Vaillancourt
32a2254da9
Tweak some help text.
2022-03-29 16:44:21 -04:00
Sage Vaillancourt
857219a4e8
Remove readFromEnvironment().
...
Something about it was buggy. Might be worth coming back to.
2022-03-29 16:31:23 -04:00
Sage Vaillancourt
f12d8bea7f
Start reading from HOME/.pebblisp.pbl for config.
2022-03-29 16:06:57 -04:00
Sage Vaillancourt
2b09187a94
Add readFromEnvironment() for reading without cloning.
...
Define the REPL prompt in the environment.
2022-03-29 15:49:53 -04:00
Sage Vaillancourt
79a2d09995
Adjust repl to allow dropping the parens around `?`
...
`?` with no arg also returns its own help text.
Improve web help texts.
2022-03-29 15:30:28 -04:00
Sage Vaillancourt
803935c637
Move help directly into env.
...
Fix repl leak.
2022-03-29 15:09:36 -04:00