Sage Vaillancourt
3d48c2eae0
Added `loadfile` to standalone.
...
Tests now manually load the library file, instead of needing it to be
installed.
2021-07-04 21:49:41 -04:00
Sage Vaillancourt
fc3fcf34ed
Added missing cleanObject() call
2020-11-08 15:26:28 -05:00
Sage Vaillancourt
a3fe0b075d
Remove lingering printObj() from defe
2020-11-08 11:48:50 -05:00
Sage Vaillancourt
18b1e28185
Script dir set in Makefile. Rename exec to `pl`
...
Changed install dir.
General cleanup of Makefile.
Added `make uninstall` to Makefile.
Tests still require that lib scripts already be installed to pass.
2020-11-07 00:14:19 -05:00
Sage Vaillancourt
0962601976
Move library-like functions into examples/lib.pbl
...
Remove `tip` demo function for now. May make a move toward a folder of
.pbl files to test with, and it will be re-included then.
2020-11-06 16:12:52 -05:00
Sage Vaillancourt
775be84f5f
Add examples/. Install to system on `make install`
...
Installs examples/* to /usr/share/pebblisp
A basic REPL is one of these examples, replacing the built-in C version
with one actually written in PebbLisp. It can be invoked the same way:
running `pl` without any arguments.
2020-11-06 15:40:41 -05: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
31fcf0c2d8
Try to skip double evaluations in list
2020-11-04 15:24:09 -05:00
Sage Vaillancourt
68705da88f
No longer evals (x) to x
2020-11-03 14:44:37 -05:00
Sage Vaillancourt
d8d8231f0d
Break up evalList() and document the new functions
2020-11-03 14:35:47 -05:00
Sage Vaillancourt
a39c6b2c53
Comments and renaming in evalDefArgs()
2020-11-03 09:46:34 -05:00
Sage Vaillancourt
8c71fd2242
Use more cloneObject()
2020-11-03 00:07:08 -05:00
Sage Vaillancourt
e0153528a1
Take input in standalone. Print numbers as chars
2020-11-02 16:38:37 -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
875228a2b6
Add `isstr` to type-checking collection
2020-11-02 15:29:03 -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
058bd302df
`def` can bind multiple vars at once
...
For example `(def (a b) (10 15))` binds `a` to 10, and `b` to 15
2020-11-02 13:42:37 -05:00
Sage Vaillancourt
3319fdf2c3
Lambdas return only last item. EOL file comments
...
Added (penv) to print the current environment
Changed "Duplicate" test to work with new Lambda structure
2020-11-02 12:40:42 -05:00
Sage Vaillancourt
f9cb2d544a
More robust comment processing
2020-11-02 07:57:13 -05:00
Sage Vaillancourt
54e2e09c5c
Add explicit (print) function
2020-10-30 14:36:44 -04:00
Sage Vaillancourt
99fc088d3e
Try to be less strict about whitespace in files
2020-10-30 09:52:46 -04:00
Sage Vaillancourt
b5648963a7
Correct string equality check
2020-10-30 09:07:09 -04:00
Sage Vaillancourt
b443a54822
Add `pre` for prepending to lists
2020-10-29 11:23:35 -04:00
Sage Vaillancourt
9486854267
Basic file execution
2020-10-29 11:18:06 -04:00
Sage Vaillancourt
7b649fdf16
Add `isnum` and some tests
2020-10-28 18:09:57 -04:00
=
68e062e2e0
Add TYPE_OTHER, subscriptions, and PebbleObjects
...
Move most file-local variables from calc.h to calc.c (so calc.h can be included)
Quick hack to get simple TYPE_LAMBDA evaluated
Add pebcom files for time/vibe/eventually battery etc. functions
Add TYPE_OTHER, so that pebble-specific (and potentially other) objects can be used in PebbLisp
Created PebbleObject/PebbleType to work as a sort of tagged pointer, to be used as a TYPE_OTHER object
Add some functions for creating/editing windows and textlayers from within PebbLisp
Added subscribe(), enabling lambdas to be run at set time intervals
2020-08-09 20:03:02 +01:00
=
5644a46c3c
Add OTHER type. Auto-open script 0 on code-send
2020-08-03 16:21:04 +01:00
=
a5ecb1b3aa
Added TODO. Text size adjusts with code length
...
Can handle hex and binary. Other cleanup
All tests pass
2020-08-02 21:16:26 +01:00
=
81d5a545cf
Some new list functions and better error handling
...
New list functions include (append) (at) (rest) and (reverse). Single quotes now supported for strings.
2020-05-28 15:28:28 +01:00
=
44c9c7a8a1
Use malloc'd strings. Add filter function
2020-05-22 06:16:45 +01:00
=
7ad541eb02
Variableize Makefile and adjust pebble tokens
...
Also made repl() a void function
2020-05-20 01:37:15 +01:00
=
8bdf42f6fd
Revert "Add basic struct notion and tests."
...
This reverts commit 95762976c5
.
Turns out these structs are not implemented well.
2020-05-18 02:22:39 +01:00
=
95762976c5
Add basic struct notion and tests.
...
Don't auto-run tests in debug mode. Some new tests fail for list-related reasons (some work in the REPL).
2020-05-18 00:00:19 +01:00
=
80967b9275
Broke lib-type code into array. New numparse errs
2020-05-16 19:31:14 +01:00
=
c97cbe850c
Ensure plain lists have elements evaluated
...
Add relevant tests. Add new doc comments. Some code shifting.
Tests pass. Valgrind is clean.
2020-05-16 15:46:19 +01:00
=
efb151d0ef
All known memory leaks handled!
...
Watch the commented `if` -127,7 +137,10 @ Object eval for weird behavior
2020-05-16 04:22:08 +01:00
=
f488e29c54
Implement liberal string copying and destruction
2020-05-15 21:28:16 +01:00
=
58705b4aa9
Cat with `+`; Related tests. Reordered pebblisp.c
2020-05-15 05:43:08 +01:00
=
1c82c6f726
Fixed some parsing (tests pass!). Some clean up.
2020-05-15 04:51:59 +01:00
=
8a45444c52
Some clean-up. Removed NO_REPL (redundant via cli)
2020-05-11 06:15:44 +01:00
=
60d6022d46
Multi-statements in cmdline args. Added tests.
...
Commented out unnecessary deleteEnv() in main(). Was segfaulting. May be a bigger bug, there.
2020-05-10 19:16:50 +01:00
=
340af00a29
Enable multi-statements in one line. Break out env
2020-05-10 18:52:22 +01:00
=
263af226b7
Improved testing. Added `spent` and '"' to pebble
...
Tests automatically run on `make`. Removed breaking cleanObject() in parseEval()
2020-05-10 17:51:46 +01:00
=
d83fa29bb4
Began `cat` code and added `spent` demo func
2020-05-10 07:27:59 +01:00
=
874420b3d5
Adjusted func types to account for possible eval
...
Basic ops work with lists. For example (+ 5 (10 15)) => (15 20)
2020-05-10 04:53:10 +01:00
=
d9c860805f
Turns out recursion worked the whole time.
...
Fixed issue with too-small REPL input buffer...
2020-05-10 03:32:26 +01:00
=
cb945a1e41
Seem to have resolved bad nesting issue
...
copyList() now properly deep-copies.
Recursive functions still not working.
2020-05-10 01:39:01 +01:00
=
96abccec7e
Lead on nested function borkage (pebblisp.c:222)
2020-05-09 19:57:21 +01:00
=
3e62d57166
Commands can be issued as args to the executable
2020-05-08 17:08:14 +01:00
=
29aa001de8
Clean-up. Added startList(). Fixed `T` and `F`
2020-05-08 17:00:14 +01:00