Sage Vaillancourt
f458b52a17
Add refcount to StaticFunction.
...
Small appendf() macro for object-stringing.
2022-04-18 09:59:57 -04:00
Sage Vaillancourt
b0e89cafd4
Toying with a more optimized function representation.
...
Starting with just struct accesses.
2022-04-14 16:05:46 -04:00
Sage Vaillancourt
3f4d8fd7af
Start dropping support for semicolon separators.
...
Simplify some error functions.
Oh, right. strdup() exists.
2022-04-14 00:31:51 -04:00
Sage Vaillancourt
54410030f7
Add throw() macro.
...
Simplifies the creation of complex error messages.
2022-04-13 15:17:59 -04:00
Sage Vaillancourt
d9d2bca8c8
Some optimization attempts in progress.
...
Toying with a more efficient native-function-use implementation.
Replace getErrorCode with a macro.
Store initial slice array on the stack, mallocing at the end.
2022-04-12 22:42:41 -04:00
Sage Vaillancourt
48b1f3c54b
Correcting some REPL behavior.
...
Add BuildListNamed() macro for optimized list creation.
2022-04-11 20:43:45 -04:00
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
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
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
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
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
61b9f79c36
Pull segfault-handling into a dedicated function and ifdef.
...
Some stringing tweaks.
2022-04-05 16:41:23 -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
=
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
2fb6643326
A bit of cleanup and warning-hushing.
2022-03-31 14:12:52 -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
ce6c536567
Fix env memory bug.
...
Fix webby.pl::singleton.
Add basic-auth user/pw to Request plstruct.
2022-03-29 14:40:28 -04:00
Sage Vaillancourt
a444bc11bb
Use dynamically-sized strings for stringObj.
...
Fix webby.pl's `reduce` usage and web.c's struct creation.
2022-03-29 14:01:44 -04:00
Sage Vaillancourt
af7a2e6265
Cleanup and a couple (micro) optimizations.
2022-03-28 23:51:05 -04:00
Sage Vaillancourt
66a07e395c
Add some runtime type-checking.
...
Adjust simple-ops structure.
2022-03-28 13:19:44 -04:00
Sage Vaillancourt
e22e022cd8
Reference count strings.
2022-03-28 09:56:34 -04:00
Sage Vaillancourt
34032cb1c6
Simplify Environment struct.
...
Fill in envForLambda with errorObjects if not enough are provided.
Move addStructDef() into env.c
Add dedicated Dictionary struct to env.c
env->size -> env->capacity
2022-03-27 18:52:56 -04:00
Sage Vaillancourt
69cf9212d7
Simplify several functions.
...
Namely, printObj() and _copyList().
Remove separate cloneList() function.
2022-03-27 00:49:10 -04:00
Sage Vaillancourt
158c21f441
Reference count LAMBDAS.
...
Remove more unused code/checks.
Simplify evalList (though it could use more work).
2022-03-26 19:51:52 -04:00
Sage Vaillancourt
5226640fb6
Some stringing cleanup and unused code removal.
2022-03-26 12:54:38 -04:00
Sage Vaillancourt
3398729ab8
Track length of stringObj().
...
Use this to simplify catObjects().
2022-03-24 23:07:34 -04:00
Sage Vaillancourt
0a649095ab
Start switch to array-based functions.
...
No more mandatory two-params, though several things are still busted.
2022-03-24 16:59:59 -04:00
Sage Vaillancourt
d743970b1a
Tweak (eval) to accept SLIST arguments.
...
Tweak implicit-cat detection.
Explicit empty-string notation in test display.
A couple more tests.
2022-03-23 01:00:11 -04:00
Sage Vaillancourt
097cbf6a5c
Start some internal testing frameworking.
2022-03-21 12:33:57 -04:00
Sage Vaillancourt
3bf65577c0
Add help text for STANDALONE.
...
Pull most user functions into the new plfunc.
Could integrate some tests directly into pl with --run-tests
2022-03-20 03:50:43 -04:00
Sage Vaillancourt
30e8c87e66
General code clean-up.
2022-03-19 22:25:20 -04:00
Sage Vaillancourt
9da4649a27
Several small additions.
...
Add basic allocation tracking.
Add extra error context
- more useful for debugging the language than programs written in it
Let reduce work on a single non-list item. May be removed.
Add more testing.
Add test filtering.
Fix triple-quotes.
2022-03-18 16:12:39 -04:00
Sage Vaillancourt
711719289f
Several changes.
...
Add `reduce` and `islist`.
- Reduce is broken with lambdas for some reason.
Remove `switch` from lib (breaks `penv`).
More detailed lambda to-stringing.
A bit of fixing for lambdas that return lambdas.
Re-org Object fields for simpler visual debugging.
Let `cat` work with one argument.
Add prompt option for `inp`.
Some more refinement of the webby.pl example.
2022-03-16 16:50:55 -04:00
Sage Vaillancourt
b390e272a7
Remove Makefile testing code.
...
Revert disabled printd() to a semicolon.
2022-03-15 16:53:34 -04:00
Sage Vaillancourt
1d5621923c
Further flesh-out structs.
...
Temporarily disable http due to buggy Ubuntu libmicrohttpd.
Add a way to access their fields with `'s`.
- Uses some fairly hacky parseAtom additions. Needs to be refined.
Add structCapacity to Environment.
Add global Environment pointer.
Use structDef indexes instead of direct pointers.
- Easier to increase capacity this way
strcpy struct field names
2022-03-15 15:27:02 -04:00
Sage Vaillancourt
6c8ff04711
Extremely barebones struct object implementation.
2022-03-14 16:52:08 -04:00
Sage Vaillancourt
e2c977e95a
Finally some consistent styling.
...
Centralized printf/printd defines in object.h
Removed null/isList checking from FOR_POINTER_IN_LIST
2022-01-07 16:55:03 -05:00
Sage Vaillancourt
55d39431b1
Add TYPE_SLIST.
...
Not yet stable, but allows manipulation of lists without immediate
evaluation.
2021-12-15 14:38:52 -05:00
Sage Vaillancourt
d36f1bf162
Remove single-quote support for strings.
...
Add triple-quote support.
Switch to structs for handling errors.
2021-12-13 10:47:35 -05:00
=
3d8e2d30d4
Add LOW_MEM and SIMPLE_ERRORS flags for aplite.
...
LOW_MEM drops some functionality (like `defe`) for very low memory devices like
aplite. SIMPLE_ERRORS is enabled when compiling with LOW_MEM, and overrides the
new error-with-context functionality with older, less intensive methods.
Also marked more code for standalone compilation only.
2021-07-21 19:31:40 +01:00
=
c142730837
Errors can have context to make them more useful.
...
External:
Error changes.
User windows will show string reps of all object types
Internal:
Some re-org and renames in calc.
Add stringNObj for more controlled string-receiving.
Note: currently aplite has a hard time with larger scripts, possibly because of
recent changes. Not sure how much can be done about it, but I'm investigating.
2021-07-21 16:26:04 +01:00
Sage Vaillancourt
77c9c39295
Check indexes etc for `at`
2021-07-05 01:13:59 -04:00
Sage Vaillancourt
0c9c876d00
Some type-check functions. Consistent 'if' styling
2021-07-04 23:48:26 -04:00
Sage Vaillancourt
7c7a68df5f
Add `iserr`, `defe`. Fix `eval`. Increase env size
...
`iserr` is a basic type-check like `isnum`
`defe` adds a string to the environment as the equivalent symbol
`eval` can take in variables or functions, instead of just raw strings
Broke type-printing into its own function
Errors maxing out an environment. Likely extending incorrectly
2020-11-06 15:07:12 -05:00
Sage Vaillancourt
f8176fef4f
Add plain stringFromSlice()
...
Doesn't try to ignore quote marks. objFromSlice() utilizes it, but should have the same behavior as before.
2020-11-02 15:55:55 -05:00
Sage Vaillancourt
963996f3a0
Add (eval) function, for evaluating strings
...
Added a few tests for this new function
2020-11-02 15:46:17 -05:00
Sage Vaillancourt
78f5b98f9f
Don't print newlines on (prn) or last expr in file
2020-11-02 15:23:04 -05:00
Sage Vaillancourt
ba74561bed
Increase MAX_TOK_CNT. Impact on watch unsure
2020-11-02 12:38:51 -05:00