Commit Graph

43 Commits

Author SHA1 Message Date
Veit Heller
0adc1abd50
feat: allow for multibranches in case (#1276) 2021-07-08 20:43:48 +02:00
guberathome
0d15a57d0e
(and) and (or) now handle any number of parameters (#1251)
* feat: generalized (and) and (or) to handle any number of parameters

* feat!: removed (and*) and (or*) macros

* chore: worked around compiler issue for unit test

* fix: unit test in ./test/macro.carp

Co-authored-by: guberatsie <gunnar.bernhardt@siemens.com>
2021-06-20 21:44:04 +02:00
guberathome
0c038365d7
IO.Raw (#1243)
* feat!: move C library wrapper funtions to IO.Raw

* docs: fixed doc string for (String.allocated?)

* docs: removed superfluous parameter names for defns

* fix: replaces IO.exit by System.exit

* fix: ./test/regression.carp for (IO.read->EOF)

* fix: ./test/system.carp

* feat: implemented IO.fwrite!

* feat!: removed IO.exit

* feat!: raw character input now returns Int instead of Char

* fix: removed irritating space chars

* fix: repaired ./example/carp_demo.carp

* fix: reverted System.exit to return an Int for SDL examples

* fix: removed System.exit!

Co-authored-by: guberatsie <gunnar.bernhardt@siemens.com>
2021-06-17 17:33:10 +02:00
Veit Heller
f90d677993
feat: add Unsafe.C.asm (#1206) 2021-05-03 15:14:26 +02:00
Veit Heller
007d020e05
refactor: use assert-dynamic-equal in test (#1186) 2021-03-16 11:14:01 +01:00
Veit Heller
64b0dc4922
feat: add String.to-list (#1185) 2021-03-15 16:22:10 +01:00
Veit Heller
a6a52c7605
feat: a proper dynamic numeric tower (#1140)
* feat: a proper dynamic numeric tower

The following things were changed and/or added:
- `Dynamic.neg` was added
- `Dynamic.mod` was changed to work on float values
- `Dynamic.cxr` was changed to work with `0` instructions
- `Dynamic.=` was changed to ignore the type of the number
- `Dynamic.round` was added
- dynamic arithmetic was changed to respect the numeric type tower
- the instances of `Eq` and `Ord` for `Number` are no longer derived, so that they work across numeric types
- the instance of `Num` for `Number` was changed to work across numeric types
- `promoteNumber` was added as a type function to implement the numeric tower.

The numeric tower is as follows:
Byte -> Int -> Long -> Float -> Double

* test: add tests for cxr, neg, and =

* test: add tests for Dynamic.round
2021-01-26 06:19:00 +01:00
Veit Heller
e966f36a58
feat: add walk* (#1134) 2021-01-17 23:34:11 +01:00
Veit Heller
2023c93d62
feat: Quasiquotation (#1129)
* feat: quasiquotation

* test: add tests for quasiquotation

* fix: fix typo in call to doc

* fix: do not evaluate quasiquote too eagerly

* test: pull quasiquote test into macro

* docs: fix unquote example with better constant

* feat: add quasiquote literals

* refactor: simplify reader macros
2021-01-15 10:50:04 +01:00
Veit Heller
afa9b1223d
Respect use in dynamic lookup (#1122)
* fix: respect use in dynamic lookup

* refactor: apply ormolu format

* test: add dynamic use test
2021-01-12 12:52:54 +01:00
hellerve
ac6979fcbb macros: add doto and doto-ref 2020-08-25 11:58:20 +02:00
Nils 'Linkie Pi' Reid
d8a9e9ec2c Added a test for while in dynamic code. 2020-05-08 16:56:20 +02:00
hellerve
80d1086cb7 tests: better dynamic tests 2020-05-05 15:09:18 +02:00
hellerve
5838136f83 core: rename dynor and dynand and check in docs 2020-05-04 23:47:06 +02:00
hellerve
a761b561e3 all: use dynor and dynand 2020-05-01 12:50:31 +02:00
Erik Svedäng
8e04cb476e Renamed Dynamic.String.join and Dynamic.Symbol.join to concat. 2020-04-30 13:32:54 +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
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
hellerve
7c7bb71584 eval: final rewrite version 2020-04-17 11:58:28 +02:00
Scott Olsen
79c88b7395 Tests: Add test for Dynamic.map 2019-09-10 22:12:00 -04:00
hellerve
439f734809 core: add gensym-with 2019-09-09 22:33:56 +02:00
hellerve
f992fb4582 core: add gensym 2019-09-09 09:59:22 +02:00
hellerve
3768c42d23 core: add const-assert 2019-05-22 20:01:03 +02:00
hellerve
a7cb1fb46f dynamic: add read-file 2019-05-14 13:51:27 -04:00
hellerve
a1f5b1fc2f core: add while-do macro 2019-04-30 21:42:34 +02:00
hellerve
3083a1e5f1 core: add Symbol.join 2019-04-10 08:25:54 +02:00
Erik Svedäng
0049c13111 Renamed 'defdynamic' to 'defndynamic'. 2019-03-13 18:49:48 +01:00
hellerve
ca22bfc8cd test: use deftest everywhere 2018-11-08 07:16:52 +01:00
hellerve
e4ee7cd153 eval: rename mor and mand to Dynamic.or and Dynamic.and 2018-09-28 10:08:06 +02:00
hellerve
023dfa1ae3 all: make and and or macros 2018-09-23 09:34:38 +02:00
Craig Roy
ac4c8113c5
Merge branch 'master' into master 2018-09-14 20:43:12 +01:00
hellerve
0090b5caf3 test: test Project.get-config 2018-09-13 07:11:48 +02:00
Craig Roy
92501770e6 Print results as part of test macro 2018-09-13 00:13:03 +01:00
Chris Hall
b9fe2ab340 Fixing trailing bracket style in tests 2018-05-23 18:40:54 +10:00
Erik Svedäng
e80af19a39 Added prn for Strings, make 'str' not print with @ and quotes. 2018-02-06 18:37:15 +01:00
Erik Svedäng
26887f3716 Changed type signature of (set! ...) form. 2018-02-02 07:19:10 +01:00
hellerve
a048d2f931 core: added and*, or*, str*, and println* macros 2017-12-29 11:49:51 +01:00
hellerve
1ae8efbdcb tests: added and and or shortcircuit tests 2017-12-22 13:07:38 +01:00
hellerve
b5c42fbced src: extended = for all numeric types, added <, >, and, or, and not 2017-12-21 17:02:34 +01:00
hellerve
ffe4913a29 core: added suggestions of @eriksvedang to new macros 2017-12-15 09:27:06 +01:00
hellerve
95f74a71bd tests: added comment test 2017-12-15 09:26:27 +01:00
hellerve
0ad340ad55 core: added useful macros to the standard library 2017-12-15 09:26:21 +01:00