Commit Graph

558 Commits

Author SHA1 Message Date
Erik Svedäng
bf4fed793a
Merge pull request #833 from hellerve/veit/fix-830
Autogenerate Tuple types and document
2020-05-26 20:51:46 +02:00
hellerve
be8424657d core: rename unsafe-range to range-or-default 2020-05-24 12:26:18 +02:00
hellerve
9be2b8e4fb core: autogenerate Tuple types and document 2020-05-24 11:49:27 +02:00
Jorge Acereda
59ef5bbf2b Added --compile-fast to compile with tcc. 2020-05-21 20:04:54 +02:00
hellerve
74d734903e core: move range into array ext and add unsafe-range 2020-05-21 15:23:29 +02:00
hellerve
3353427dd9 core: make Array.range safe 2020-05-18 22:59:41 +02:00
hellerve
1f76f94c1a test: add char literal test 2020-05-18 09:52:01 +02:00
hellerve
b9b5ffba45 parse: add \return, \backspace, \formfeed, and \u unicode literals 2020-05-17 12:02:42 +02:00
Erik Svedäng
f71613a0c8
Merge pull request #796 from dbalan/freebsd_platform
Add FreeBSD as a supported platform
2020-05-13 21:25:20 +02:00
Erik Svedäng
14a0d7e722
Merge pull request #799 from hellerve/veit/string-to-bytes
Add String.to-bytes
2020-05-13 20:59:37 +02:00
hellerve
468c232741 core: add String.to-bytes 2020-05-13 17:15:26 +02:00
Dhananjay Balan
34b63fe1c7 Use Double.approx to compare exp results 2020-05-13 16:52:32 +02:00
hellerve
c569666a0a core: make from-string better 2020-05-12 22:33:40 +02:00
Erik Svedäng
aae743fb35
Merge pull request #769 from scolsen/implement-prim
Add an `implements` primitive, update core
2020-05-12 21:45:29 +02:00
Erik Svedäng
2121b87151
Merge pull request #787 from hellerve/veit/add-new-asserts
Add assert-ref-equal, assert-just, and assert-nothing
2020-05-12 19:59:36 +02:00
hellerve
9e2c2fe2fd test: add assert-ref-equal, assert-just, and assert-nothing 2020-05-12 14:53:42 +02:00
Erik Svedäng
9ba6a26ff1
Merge pull request #782 from TimDeve/enumerate-empty-arrays
Makes enumerated work with empty arrays
2020-05-12 12:03:14 +02:00
scottolsen
7d50abe430 lambda message -> FN 2020-05-11 15:13:46 -04:00
Tim Deve
8fc5ce2946 Removes usage of range in enumerated
`range` signature is likely to change in the future
this change gets ahead of that but using a more
'procedural' style.
2020-05-11 19:55:09 +01:00
scottolsen
681054be63 Merge branch 'master' of https://github.com/carp-lang/Carp into implement-prim 2020-05-11 14:42:11 -04:00
Tim Deve
58ab18da46 Makes enumerated work with empty arrays
This is a work around for https://github.com/carp-lang/Carp/issues/776
the proper fix would be to allow range to take `(range 0 0 1)` inputs
but the decision about what the correct behavior should be hasn't been
made.
2020-05-11 16:37:07 +01:00
Jorge Acereda
9b08b6df3c Merge 2020-05-11 16:10:35 +02:00
Jorge Acereda
83e8c1a874 Fix Char_str(). 2020-05-11 16:08:40 +02:00
Tim Deve
8e6d9e5060 Updates expected because the switch from λ to Fn 2020-05-11 13:06:10 +01:00
Tim Deve
ba9b883fbd Makes test bash script running on MSYS/Git Bash
Reenables Windows CI
2020-05-11 12:40:31 +01:00
Scott Olsen
70e97f82f8 Merge branch 'master' of https://github.com/carp-lang/Carp into implement-prim 2020-05-10 23:19:32 -04:00
Scott Olsen
a3d4443f79 Add tests for implements/interfaces
These tests just check some basic assumptions about the way interfaces
are implemented using the `implements` primitive

- They can be implemented with functions of any name.
- They can be implemented retroactively.
- `Implements` declarations can precede definitions.
2020-05-10 23:09:48 -04:00
Scott Olsen
26131f2b1c Add remaining implements declarations 2020-05-10 22:53:35 -04:00
Scott Olsen
f13a2fdd9d Add some more calls to implement to make tests pass 2020-05-10 13:32:22 -04:00
Nils 'Linkie Pi' Reid
b132f4f922 Merge branch 'master' of https://github.com/carp-lang/Carp into dynamic-while 2020-05-09 09:28:42 +02:00
hellerve
3890cb8258 test: add regression test for nested lets and set! 2020-05-08 18:01:35 +02:00
Nils 'Linkie Pi' Reid
d8a9e9ec2c Added a test for while in dynamic code. 2020-05-08 16:56:20 +02:00
Erik Svedäng
78f85d73c1
Merge pull request #747 from hellerve/veit/better-dynamic-tests
Better dynamic tests
2020-05-05 15:20:08 +02:00
hellerve
80d1086cb7 tests: better dynamic tests 2020-05-05 15:09:18 +02:00
Erik Svedäng
26a4b02009 Fix some memory errors (that should be compiler errors). 2020-05-05 14:08:07 +02:00
Erik Svedäng
6f70dbd18e Merge branch 'master' into match-on-refs 2020-05-05 13:57:58 +02:00
Erik Svedäng
685a627356
Merge pull request #746 from scolsen/polymorphic-constructors
Polymorphic Constructors
2020-05-05 09:53:56 +02:00
Erik Svedäng
9951468a5a
Merge pull request #742 from hellerve/veit/fix-719
Make primitives proper AST objects
2020-05-05 09:45:00 +02:00
scottolsen
b5606480ea Update Spec tests to handle new ConcreteNameTy 2020-05-04 17:58:01 -04:00
hellerve
5838136f83 core: rename dynor and dynand and check in docs 2020-05-04 23:47:06 +02:00
Erik Svedäng
bd5abfbf11 Merge branch 'static-array-functions' of https://github.com/TimDeve/Carp into TimDeve-static-array-functions 2020-05-04 13:14:37 +02:00
Tim Dévé
83c4920f08 Fixes stack-use-after-scope error when returning static arr from let 2020-05-04 12:11:50 +01:00
Erik Svedäng
0e40585cbe Merge branch 'static-array-functions' of https://github.com/TimDeve/Carp into TimDeve-static-array-functions 2020-05-04 11:58:07 +02:00
Erik Svedäng
a7d2f13dc1 4 test cases for returning-of-ref bug. 2020-05-04 11:56:23 +02:00
Tim Dévé
da98a770be Adds StaticArray nth & contains? 2020-05-04 09:35:39 +01:00
Tim Dévé
acc5dbb914 Adds StaticArray sum, index-of, element-count, predicate-count, aupdate! & swap! 2020-05-04 09:35:39 +01:00
Tim Dévé
5965b098bb Adds StaticArray reverse! 2020-05-04 09:35:39 +01:00
Tim Dévé
b5d363c85e Adds StaticArray minimum & maximum 2020-05-04 09:35:39 +01:00
Tim Dévé
27ce300648 Adds StaticArray first, unsafe-first, last & unsafe-last 2020-05-04 09:35:39 +01:00
Tim Dévé
b87fd0911c Adds StaticArray find & find-index 2020-05-04 09:35:39 +01:00
Tim Dévé
ce3f53518f Adds StaticArray empty? any? & all? 2020-05-04 09:35:39 +01:00
Tim Deve
85abcbbf0a Adds Array.from-static function 2020-05-04 09:35:37 +01:00
Tim Dévé
3222e5cd22 Adds tests for ArrayStatic map! and reduce 2020-05-04 09:30:45 +01:00
hellerve
a761b561e3 all: use dynor and dynand 2020-05-01 12:50:31 +02:00
Erik Svedäng
504f63ffb4 Merge branch 'zero-sumtypes' of https://github.com/hellerve/Carp into hellerve-zero-sumtypes 2020-04-30 14:46:35 +02:00
hellerve
7eaa30d663 core: remove result.zero 2020-04-30 14:40:01 +02:00
hellerve
2b8fa4d2a1 add test cases for zero in maybe and result 2020-04-30 14:33:18 +02:00
Erik Svedäng
8e04cb476e Renamed Dynamic.String.join and Dynamic.Symbol.join to concat. 2020-04-30 13:32:54 +02:00
Erik Svedäng
234aa9fe60 One more test. 2020-04-30 12:56:04 +02:00
Erik Svedäng
81bad8795c A test. 2020-04-30 12:45:55 +02:00
scottolsen
87fe06bfbc Add a few more cases to nest matches 2020-04-29 18:05:27 -04:00
scottolsen
9ee9f5fe57 Add general tests for sumtype matching 2020-04-29 17:55:35 -04:00
Erik Svedäng
8f08f794b0 One more test. 2020-04-29 14:01:41 +02:00
Erik Svedäng
7b65d888f3 Some tests for nested sumtypes. 2020-04-29 13:55:31 +02:00
Erik Svedäng
2ccda81c23 Problematic test. 2020-04-29 10:54:41 +02:00
Erik Svedäng
89dcad4e79 Merge branch 'master' into static-arrays 2020-04-29 10:39:44 +02:00
Erik Svedäng
979077b388 Some cleanup and start of tests for Static Array. 2020-04-29 10:39:15 +02:00
Erik Svedäng
94ed7f0696
Merge pull request #728 from scolsen/macro-fixes
Dynamic.Curry fix and Macro Tests
2020-04-24 23:20:36 +02:00
scottolsen
ac87e8fbdc Add tests for dynamic functions
I accidentally broke `curry`, what better incentive for writing some
tests than preventing my own future silly mistakes :)

I also added and-internal because we cannot perform direct comparisons
on lists--so, instead we build member-wise comparisons by zipping, then
reduce the result using and.
2020-04-24 17:00:30 -04:00
hellerve
f35c7d91b6 test: remove safe arithmetic on windows 2020-04-24 11:04:01 +02:00
scottolsen
1602e49320 Fix macros test; add test for zip
There were some errors in the call to Dyanmic.map. I've fixed those!
I've also added a test for zip.
2020-04-20 11:24:04 -04:00
Scott Olsen
54a3101654 Merge branch 'master' of https://github.com/carp-lang/Carp into dynamic-map 2020-04-19 10:34:42 -04:00
Erik Svedäng
3b1c9607c8
Merge pull request #695 from hellerve/veit/new-evaluator
New evaluator
2020-04-17 14:45:30 +02:00
hellerve
7c7bb71584 eval: final rewrite version 2020-04-17 11:58:28 +02:00
hellerve
da32c14197 eval: make tests work 2020-04-17 11:56:03 +02:00
Tim Dévé
209136847e Adds fn Unsafe.leak that prevents destructor from being run on a value 2020-04-10 14:56:20 +01:00
Tim Dévé
eccd2103df Adds fn Pointer.to-value to get a value out of Ptr 2020-04-10 11:44:27 +01:00
Erik Svedäng
ae9491dfd7 Restore test. 2020-04-06 10:15:42 +02:00
Erik Svedäng
cb6b0d2c0f Try breaking a test in test/array.carp to see if CI catches it. 2020-04-06 10:15:04 +02:00
Erik Svedäng
f616945ebd stack test should run now, disabled a single failing test that needs fixing. 2020-04-06 10:13:21 +02:00
Erik Svedäng
2fae013a79
Merge pull request #706 from TimDeve/github-actions
Adds Github Actions CI to repository
2020-04-06 08:27:54 +02:00
Tim Deve
321ee6f819 Fixes StdInt.carp load in tests
The load call was failing on case-sensitive file systems
2020-04-04 13:21:23 +01:00
hellerve
9d6a18e4d6 test: fix args test for windows (again) 2020-04-03 23:01:20 +02:00
hellerve
30339e1026 tests: fix args test 2020-04-02 15:57:06 +02:00
scottolsen
a66a5126e6 Move Byte Order type outside of the Binary module
Issue #698 points out an bug related to reloading. The illustious
hellerve@ has discovered that the issue relates to types defined in
modules--for some reason, upon reloading, the type's delete, copy, etc.
functions are doubly defined, resulting in too high or a number of
functions for Carp to work out the dependencies.
2020-03-20 19:02:55 -04:00
Erik Svedäng
42ab993531 Some tests for sigs. 2020-02-21 14:02:53 +01:00
Scott Olsen
99795abe8e Update binary tests to reflect refactor
I've also added tests for the `exact` variants of the sequence
conversion functions.
2020-02-20 14:30:25 -05:00
Scott Olsen
edee6d9dc9 Add basic tests for the binary module
I've also added the Binary module to Core.carp.
2020-02-18 15:34:41 -05:00
hellerve
657f27c6ac core: add stdint types 2020-02-17 10:42:07 +01:00
hellerve
ee812b37e6 core: make subarry/substring slice 2020-02-11 09:09:30 +01:00
hellerve
66431a4c80 pattern: fix captures, add split and global-match-str 2020-02-09 13:42:39 +01:00
Erik Svedäng
4fe7ea072b Merge branch 'master' into lifetimez-with-lambdas 2020-02-07 14:34:13 +01:00
hellerve
51e263ce59 array templates: use memcpy if members aren’t managed 2020-02-07 13:10:35 +01:00
Erik Svedäng
bd7167986e
Merge pull request #653 from hellerve/veit/from-string
Add Float.from-string and Double.from-string
2020-01-29 15:06:31 +01:00
hellerve
c0c31b6ad1 core: add Float.from-string and Double.from-string 2020-01-29 11:41:06 +01:00
hellerve
29d34bbeee test: add generics 2020-01-28 21:32:15 +01:00
Erik Svedäng
ea045be426 Merge branch 'byte-type' of https://github.com/hellerve/Carp into hellerve-byte-type 2020-01-27 10:10:58 +01:00
Erik Svedäng
4801fec15d Merge branch 'veit/apply-ref' of https://github.com/hellerve/Carp into hellerve-veit/apply-ref 2020-01-27 10:07:50 +01:00
hellerve
95739d0cea core: add IO.getenv 2020-01-25 14:23:14 +01:00
hellerve
3ebe10d587 core: make Maybe.apply take function ref 2020-01-25 14:08:37 +01:00
Erik Svedäng
773824f5e7 Merge branch 'master' of https://github.com/hellerve/Carp 2020-01-23 10:12:34 +01:00
hellerve
09404798c2 core: add Result.map-error 2020-01-22 12:36:03 +01:00
GrayJack
09637e0f0d Change one of the tests output string 2020-01-18 14:27:41 -03:00
GrayJack
e60ea603d4 Add Array.unsafe-raw 2020-01-18 13:11:09 -03:00
Erik Svedäng
0ca676f337
Merge pull request #634 from hellerve/make-result-fns-ref
core: make result functions take refs
2020-01-14 10:52:05 +01:00
hellerve
3d1abf1469 commands: check char-at 2020-01-14 09:32:22 +01:00
hellerve
40f3975937 core: make result functions take refs 2020-01-13 22:40:20 +01:00
Erik Svedäng
a6fb8c2515
Merge pull request #625 from hellerve/map->
RFC: Add Array.unreduce
2019-11-27 10:58:27 +01:00
Erik Svedäng
34c314e6fe
Merge pull request #618 from sdilts/fopen-safe
Add open-file function
2019-11-25 12:42:42 +01:00
Erik Svedäng
cf276f4488
Merge pull request #608 from hellerve/pointer-arith
Add pointer arithmetic
2019-11-25 12:36:10 +01:00
Erik Svedäng
576dad0984 Merge branch 'master' into lifetimez-with-lambdas 2019-11-25 12:22:04 +01:00
hellerve
b1b84c8e3a core: rename map-> to unreduce 2019-11-21 11:05:21 +01:00
hellerve
48b8b4ec13 core: add Array.map-> 2019-11-13 10:47:22 +01:00
sdilts
67a6eb5d4c Add and update tests for open-file
+ Add file test/system.carp to test open-file
+ Update test/regression.carp with the new interface for IO.read->EOF
2019-11-08 17:20:05 -07:00
hellerve
f1f252639f core: add a byte type 2019-11-01 10:52:34 +01:00
GrayJack
96b7cdbcab Add tests for the safe nth function 2019-11-01 03:21:46 -03:00
GrayJack
07def7db23 Fix all nth usage 2019-10-31 06:23:23 -03:00
GrayJack
2c0fcbd6c9 Changes Maybe.ptr to Maybe.unsafe-ptr and all it's ocurrences 2019-10-31 05:38:47 -03:00
hellerve
2819d22729 core: add pointer arithmetic (references #423) 2019-10-30 08:09:18 +01:00
Erik Svedäng
7949f49012 Test for errors work again after renaming the .output.expected files. 2019-10-24 12:05:26 +02:00
Erik Svedäng
c4cdb4dc22 Use underscore in filenames of "test for error"-tests. 2019-10-24 10:09:52 +02:00
Erik Svedäng
e0435f159b A test for error when misusing refs in lambdas. 2019-10-24 10:08:05 +02:00
Erik Svedäng
2ae507a37e One more test for error. 2019-10-22 11:41:02 +02:00
Erik Svedäng
d75fc9c278 Test that refs depending on args to functions also are checked. 2019-10-22 11:33:26 +02:00
Erik Svedäng
476d70df7e All tests run except game (SDL) examples. 2019-10-21 15:17:17 +02:00
Erik Svedäng
1ee2b8ba3b Updated Haskell tests for Refs with lifetimes. 2019-10-18 10:35:30 +02:00
Erik Svedäng
b410586722 Added lifetime variable to 'RefTy', all tests run. 2019-10-17 12:02:49 +02:00
hellerve
314d155da8 src: fix regression when loading git 2019-10-16 11:21:46 +02:00
Erik Svedäng
84e3e49db9
Merge pull request #567 from jacereda/nix
NixOS/Nixpkgs support
2019-09-27 15:49:23 +02:00
Erik Svedäng
e8e641de99 Merge branch 'misc-fixes' of https://github.com/jacereda/Carp into jacereda-misc-fixes 2019-09-27 15:37:36 +02:00
Jorge Acereda
7b7cb5d1e5 Substitute /= interface by a generic. 2019-09-20 23:49:20 +02:00
Jorge Acereda
21d539844d Make scripts nix-aware. 2019-09-20 23:39:04 +02:00
Erik Svedäng
a44afe325e Regression test for nested lambdas (issue 342) 2019-09-18 10:22:37 +02:00
Jorge Acereda
bf8f4c04e2 Already fixed. 2019-09-17 19:33:59 +02:00
hellerve
aad568c941 core: make String.join take ref (for #562) 2019-09-16 20:22:01 +02:00
Scott Olsen
79c88b7395 Tests: Add test for Dynamic.map 2019-09-10 22:12:00 -04:00
Jorge Acereda
873ed87571 Implement get-tag for sum types. 2019-09-11 00:01:36 +02:00
Jorge Acereda
aa71647d02 Fix crashes in String.join/join-with-char with empty array. 2019-09-10 21:49:00 +02:00
Erik Svedäng
6d6f93ec28
Merge pull request #542 from hellerve/gensym
Add gensym
2019-09-10 11:13:36 +02:00
Erik Svedäng
a6d4358ead
Merge pull request #541 from jacereda/generics2
Working on generics.
2019-09-10 10:55:10 +02:00
hellerve
439f734809 core: add gensym-with 2019-09-09 22:33:56 +02:00
hellerve
a2c859c586 all: remove local-include in favor of relative-include 2019-09-09 17:56:43 +02:00
hellerve
f992fb4582 core: add gensym 2019-09-09 09:59:22 +02:00
Jorge Acereda
08af49dc62 Working on generics.
- Added Generics module.
- Some Geometry/Vector* functions hardcoded parameters to Double.
2019-09-08 13:02:04 +02:00
Erik Svedäng
b85ff6e2ea
Merge pull request #525 from jacereda/lambda-copy
Lambda copy generated bad code.
2019-09-03 10:40:58 +02:00
Jorge Acereda
b8e82b5b6f Lambda copy generated bad code. 2019-07-15 19:38:33 +02:00
Jorge Acereda
d8919bf1e8 Fix string assert, simpler/faster conditions. 2019-06-20 12:43:37 +02:00
Jorge Acereda
db6e5b87e7 Add Unsafe.coerce
Used for Maybe.ptr, fixes #494.
2019-06-17 19:30:16 +02:00
Erik Svedäng
6b677a9ba2
Merge pull request #491 from jacereda/fix-tests
Fix tests.
2019-06-13 13:25:04 +02:00
Jorge Acereda
3e6308f25d Fix tests. 2019-06-13 12:36:33 +02:00