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
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
04579664fd
update parse.c
2020-01-12 22:43:39 -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
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
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
Andrew Chambers
ec1a06cfaf
Optional default value for os/getenv.
2020-01-07 11:21:05 +13: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
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
a15d841b5b
Address #232
...
Fix segfault on macro arity mismatch in compile.c by adding missing return statements.
2019-12-31 11:33:03 -05:00
Calvin Rose
75bb8fbcd1
Amalg script included janet.h before test macros.
2019-12-30 22:08:12 -05:00
Calvin Rose
9cb25ad7b1
Remove some feature test macros.
...
_BSD_SOURCE is deprecated and not needed.
2019-12-30 21:30:13 -05:00
Calvin Rose
f361830cb2
Update feature test macro in line.c
2019-12-30 20:24:40 -05:00
Calvin Rose
9dd152dc28
Add features.h for feature test macros.
...
Because we use an amalgated build, feature
test macros should be set in a single file that
is included before any other headers, and is placed
at the top of the amalgamated build.
2019-12-30 19:06:15 -05:00
Calvin Rose
2ba4337e6f
Remove all feature test macros from janet.h
...
This should help improve compatibility with other C code.
2019-12-30 15:12:17 -05:00
Calvin Rose
48fcd927ab
Merge branch 'master' of github.com:janet-lang/janet
2019-12-30 14:26:38 -05:00
Calvin Rose
407d8af026
Address #233
...
Move _POSIX_C_SOURCE to internal header.
2019-12-30 12:31:26 -05:00
Calvin Rose
d0570b55b1
Merge pull request #231 from andrewchambers/tempfile
...
Add file/temp.
2019-12-29 20:00:17 -05:00
Calvin Rose
a964a95c1e
Fix warnings on BSDs.
2019-12-29 19:53:35 -05:00
Andrew Chambers
c2f8441572
Add file/temp.
2019-12-30 12:00:35 +13:00
Andrew Chambers
2bebace8eb
Extend file api to allow creating and checking.
2019-12-30 04:02:46 +13:00
Calvin Rose
022be217a2
Remove ==, not==, and order[<,<=,>,>=].
...
This unifies equality and comparison checking. Before, we had
separate functions and vm opcodes for comparing general values vs.
for comparing numbers, where the numberic functions were polymorphic and
had special cases for handling NaNs. By unfiying them, abstract types
can now better integrate with other number types and behave as keys.
For now, the old functions are aliased but will eventually be removed.
2019-12-28 16:04:15 -05:00
Andrew Chambers
ddc4274314
Expand docs to explain pclose semantics.
2019-12-28 15:24:10 +13:00
Calvin Rose
3492ed6d88
Windows installer pulls version from interpreter.
...
This should make version updates simpler. Also
try an make installer write to ProgramFiles instead
of ProgramFiles (x86) for 64 bit build.
2019-12-19 13:18:46 -05:00
Calvin Rose
e28262f5ab
Add array/fill
...
This function has similar semantics to buffer/fill.
2019-12-19 12:58:11 -05:00
Calvin Rose
94246f7574
Use infinite timeout to indicate non-blocking.
...
Makes more sense than negative numbers.
2019-12-18 16:07:06 -05:00
Calvin Rose
07b0ef1648
Throw error on bad thread creation.
2019-12-18 15:49:57 -05:00
Calvin Rose
6a39c4b91d
Pass thread body explicitly in thread/new.
...
Doing it via thread/send make sense, but is a bit
strange. Passing the body explicitly will make more
sense to API users.
2019-12-18 15:07:46 -05:00
Calvin Rose
b9f0f14e31
Add array/new-filled
...
Similar function signature to buffer/new-filled.
2019-12-18 13:02:50 -05:00
Calvin Rose
4238379552
Use _setjmp/_longjmp on BSDs.
...
This doesn't save the signal mask so should be a bit faster.
2019-12-18 12:18:31 -05:00
Calvin Rose
2b2c1ff917
Get rid of warning on BSDs.
2019-12-15 16:04:43 -06:00
Calvin Rose
c7912249b2
Typo in #ifdef.
2019-12-15 15:56:26 -06:00
Calvin Rose
b8004555ea
Start cleaning up defines in janet.h
2019-12-15 15:41:58 -06:00
Calvin Rose
58ff7f0788
BSD os.c fix with arc4random.
2019-12-15 12:47:12 -06:00
Calvin Rose
f1afc5b0b4
Address #214
...
This adds several common patterns, which are defined in
boot.janet. This essentially gives more primitive patterns
to work with out of the box.
Fix build when JANET_REDUCED_OS is defined.
2019-12-14 20:39:14 -06:00
Calvin Rose
bc8ee207d5
Address #219 .
...
Adds several shorthands to the C API.
2019-12-14 11:31:46 -06:00
Calvin Rose
76342540dc
Add buffer/fill. Address #221
2019-12-14 10:54:29 -06:00
Calvin Rose
56784a34a1
Address #224 - Exposed file flags in janet.h
...
A caller can check if a file is closed with
if (flags & JANET_FILE_CLOSED) ...
2019-12-14 09:03:56 -06:00
Calvin Rose
c3f1b54171
Update jpm path settings.
...
This will make it easier to use jpm as a per-project
management tool, as well as easier to set up individual
module trees.
2019-12-12 19:35:40 -06:00
Calvin Rose
9b7d642c38
Window x86 needs isnan.
2019-12-12 19:04:13 -06:00
Calvin Rose
7c2ae45809
Fix some merge issues.
...
Make everything compile, and test-install pass.
2019-12-12 17:14:36 -06:00
Calvin Rose
36b2f27873
Merge branch 'master' into threads-3
2019-12-12 17:07:03 -06:00