Calvin Rose
8fbcae6029
Remove -march=native from Makefile
...
Instead, one can pass in CFLAGS to make
2020-01-18 20:01:12 -06:00
Calvin Rose
064475cb8d
Add eachk and eachp.
...
These should make iterating over datastructures easier
without needing the loop macro.
2020-01-18 18:46:49 -06:00
Calvin Rose
f4077b678a
Allow calling next on abstracts.
...
This will allow the creation of infinte
streams, low cost generators, etc.
2020-01-18 18:09:20 -06:00
Calvin Rose
51678c1aba
Extend power of the each form
...
This changes the implementation of the `next` function which
is now used to implement each. This let's us iterate over
more types, not just tables and structs.
2020-01-18 17:55:07 -06:00
Calvin Rose
17a2fdbf1b
Update for sourcehut builds.
...
We needed to include repo in sources array.
2020-01-18 14:42:02 -06:00
Calvin Rose
65d7c3eed1
Use stderr for getline output instead of stdout.
2020-01-18 14:34:29 -06:00
Calvin Rose
41bb8c543b
Merge branch 'master' of github.com:janet-lang/janet
2020-01-18 09:46:37 -06:00
Calvin Rose
bbd7355313
Merge pull request #259 from andrewchambers/futureproofhash
...
Make hash api more future proof.
2020-01-18 09:45:47 -06:00
Calvin Rose
772916593b
Address #262
...
Pressing tab only does one thing at a time.
2020-01-18 09:44:59 -06:00
Calvin Rose
9d8af7355f
Improve getline.
2020-01-18 00:30:46 -06:00
Calvin Rose
521a29446f
Don't rely on obscure printf features.
...
They may not work on all platforms.
2020-01-18 00:27:40 -06:00
Calvin Rose
a8e4c4bed0
Add special forms and sort completions.
...
Also fix case when no completion is needed.
2020-01-18 00:17:08 -06:00
Calvin Rose
6471b4d100
Add preliminary repl completion via tab.
2020-01-17 23:03:50 -06:00
Calvin Rose
7f9b2b34d1
Clarify import docs for dynamic bindings.
2020-01-17 18:06:00 -06:00
Calvin Rose
789c5f135a
Add ctrl-a and ctrl-e to control line in repl
...
Emacs to start of line and to end of line key bindings.
2020-01-17 09:33:30 -06:00
Andrew Chambers
344f0b743d
Make hash api more future proof.
2020-01-17 17:25:40 +13:00
Calvin Rose
d8841de180
Address #188
...
Delete repo folder if clone fails.
2020-01-16 22:14:23 -06:00
Calvin Rose
23c7c3bf1c
Allow disabling keyed hash function (prf) in conf
...
In some cases, one might want to disable what is currently
SipHash for speed / better security mechansims. For example, using
red black trees for caches rather than hash tables.
2020-01-16 21:06:03 -06:00
Calvin Rose
3d117804dd
Merge branch 'master' into HEAD
2020-01-16 20:08:34 -06:00
Calvin Rose
77bb0ebe3f
Add limits to format to discourage huge prints.
...
This should make system crashing prints happen less often in repl.
Instead, display a ...
2020-01-16 18:57:01 -06:00
Calvin Rose
6d9e51e4be
Fix documentation for if-with.
...
It was the same as when-with.
2020-01-16 18:12:05 -06:00
Calvin Rose
174ff87946
Change printing of abstracts with tostring in pp
...
This change makes pretty printing not hide "abstractness".
2020-01-16 18:10:17 -06:00
Andrew Chambers
ea02b2fde9
Use siphash for string hashing.
...
The hash key still needs to randomly initialized
for the security advantage, but this patch is a
step closer to avoiding hash based DOS.
Further work may including exposing the raw hash
function for use by abstract types who also choose to
implement hash.
2020-01-17 12:06:55 +13:00
Calvin Rose
962cd7e5f5
Add when-with and if-with
...
This is useful for reading from files.
2020-01-15 22:56:40 -06:00
Calvin Rose
65be9ae095
Add defer and assert to the core.
2020-01-15 22:39:14 -06:00
Calvin Rose
bc2bac8cd3
Fix memory issue in allocating decode buffer.
...
Since the decode table is currently a single table
per thread, we just make it a thread local to avoid
issues.
2020-01-15 19:58:14 -06:00
Calvin Rose
b567ece401
Address #252
...
Add repeat form (instead of exactly).
2020-01-14 19:58:03 -06:00
Calvin Rose
f001b0a40c
Update Changelog
...
Also change how add-body in jpm works. We keep an array of thunks
instead of a single thunk.
2020-01-13 20:51:11 -06:00
Calvin Rose
04579664fd
update parse.c
2020-01-12 22:43:39 -06:00
Calvin Rose
f709d7eb40
Add module/add-paths
...
This should make it much easier to make custom DSLs work
well with the import system. No need to mess about with import paths,
things will just work.
2020-01-12 20:59:45 -06:00
Calvin Rose
2df8660f8b
Avoid buffer overrun
...
On very long binding names > 256 characters, a buffer overrun would be
trigger in janet_cfuns. Not a huge issue, since this is not really code
that would ever be user facing, but we can fix this.
2020-01-12 11:31:41 -06:00
Calvin Rose
a68ee7aac6
Update Copyright 2020.
2020-01-12 10:50:37 -06:00
Calvin Rose
f0e04e734c
Test for regressions in #249
...
Use two separate natives in compiled executable.
2020-01-12 10:45:59 -06:00
Calvin Rose
0e7cf51890
Fix MSVC warnings.
2020-01-12 10:19:51 -06:00
Calvin Rose
b54d9725d8
Fix MSVC errors.
2020-01-12 10:18:03 -06:00
Calvin Rose
2f0570aad6
Address #249
...
If JANET_ENTRY_NAME is defined, we are compiling into a single binary.
In this case, we don't want to define the config symbol multiple times
with same name, as this causes the linker error.
2020-01-12 10:13:06 -06:00
Calvin Rose
3d40c95e80
Add ability to Janet signal from C functions.
...
While C functions are not re-entrant, signaling from a C function
can be used to implement async returns. When resuming a fiber that
signalled from within a C function, the fiber is started after the
instruction that emitted the signal. The resume argument is used
as the return result from the c function.
2020-01-10 20:44:16 -06:00
Calvin Rose
ed5027db5d
Address #242
...
Synchronize critical sections in setenv/getenv/environ.
2020-01-06 22:41:18 -06:00
Calvin Rose
c4047f3f88
Merge pull request #247 from andrewchambers/getenvdflt
...
Optional default value for os/getenv.
2020-01-06 17:27:33 -06:00
Andrew Chambers
ec1a06cfaf
Optional default value for os/getenv.
2020-01-07 11:21:05 +13:00
Calvin Rose
17e47a798c
Address #244
2020-01-05 09:26:21 -06:00
Calvin Rose
212aceedc6
Fix useless type conversion.
2020-01-02 22:12:07 -06:00
Calvin Rose
e6f897f4ef
Merge branch 'master' of github.com:janet-lang/janet
2020-01-02 22:10:13 -06:00
Calvin Rose
6c7f376410
Try to remove potential overflow bugs.
...
Also make integer to size_t casts explicit rather than relying on
int32_t * sizeof(x) = size_t. This is kind of a personal preference for
this problem.
2020-01-02 22:08:17 -06:00
Calvin Rose
e93e237c67
Merge pull request #236 from andrewchambers/scratch_calloc
...
Add scratch calloc.
2020-01-02 20:29:10 -06:00
Calvin Rose
a1cd759759
Merge branch 'master' of github.com:janet-lang/janet
2020-01-02 20:28:10 -06:00
Calvin Rose
a2c45a697b
Address #234 in array.c
2020-01-02 20:27:38 -06:00
Andrew Chambers
acdbf8911c
Add scratch calloc.
2020-01-03 12:10:17 +13:00
Calvin Rose
9269372768
Merge pull request #235 from theosotr/fix
...
Fix faults in Make build
2020-01-02 15:05:04 -06:00
Thodoris Sotiropoulos
5575e7577a
Fix faults in Make build
2020-01-02 22:15:55 +02:00