Commit Graph

929 Commits

Author SHA1 Message Date
Erik Svedäng
889f55fe8f
feat: Remove address (#1223)
* chore: Abuse deftemplate to get rid of Address

* chore: Avoid semicolon at end of define

* fix: address should be useable as an argument to a HOF

* chore: adapt examples to new address signature

* fix: Remove Address from typeOf

* fix: Remove more uses of Address

* fix: Remove more mentions of address in the Haskell code

* fix: Remove test that ensure you can't take the address of non-symbols

* refactor: Moved `address` to Pointer.carp

* refactor: Move address into Pointer module

Co-authored-by: Jorge Acereda <jacereda@gmail.com>
2021-05-27 22:04:46 +02:00
Veit Heller
c52dae9417
fix: re-add benchmarks (#1166) 2021-02-04 08:35:48 +01:00
Veit Heller
d20414e87d
feat: Add drop interface (#1088)
* add sketch for drop

* add drop example

* correct drop ordering

* fix: simplify drop and add to deleter

* docs: add drop docs

* fix: use a sound lifetime var
2021-01-31 21:15:10 +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
02936cc74c
feat: Derive (#1120)
* core: add derive

* fix: fix errors with set!

Notably, don't type check dynamic bindings (which can be set to
whatever) and eliminate a hang that resulted from not handling an error
at the end of the `set!` call. Also refactors some of the code in
efforts to make it a bit cleaner.

Also adds an error when `set!` can't find the variable one calls set!
on.

* feat: better derive

* test: add error test for derive

* document derive

* add derive to core documentation to generate

* core: add derive

* fix: fix errors with set!

Notably, don't type check dynamic bindings (which can be set to
whatever) and eliminate a hang that resulted from not handling an error
at the end of the `set!` call. Also refactors some of the code in
efforts to make it a bit cleaner.

Also adds an error when `set!` can't find the variable one calls set!
on.

* feat: better derive

* document derive

* feat: first completely working version of derive

* feat: make name of derivable customizable (thanks @scolsen)

* refactor: implement doc edits provided by @scolsen

* feat: change argument order for derive

* fix: change deriver error test

* test: add derive tests

* fix: change order of derive back

* docs: fix typo in derive document

Co-authored-by: scottolsen <scg.olsen@gmail.com>
2021-01-15 10:48:34 +01:00
Erik Svedäng
f78fd16a71
refactor: Move code out of Macros.carp into other files (#1014)
* refactor: Move code out of Macros.carp into other files

* fix: Move back some macros needed in --no-core mode

* refactor: Remove weird 'evaluate' macros

* fix: Put back more macros

* fix: Remove transitive loading of Macros.carp

* refactor: Remove ArrayMacros.carp and put 'for' at top of Array.carp instead

* refactor: More splitting up

* refactor: Move back save-docs

* fix: Moved back some stuff

Co-authored-by: Erik Svedang <erik@Eriks-iMac.local>
2020-11-28 12:53:18 +01:00
rrruko
e3af878e2a
Return reference from unsafe-first/unsafe-last (#1027)
* core: return Array.unsafe-first as reference (#970)

* core: return Array.unsafe-last as reference (#970)

* Make examples and tests build
2020-11-27 10:19:06 +01:00
Erik Svedäng
a873099640
chore: Move some examples to test/produces-output (#989)
* chore: Moved examples that work more as tests to folder 'test/produces-output'

* fix: Corrections to the release script

* fix: Correct filename on Windows

* fix: Move more files around

* fix: Remove check-malloc example

* fix: Apparently unicode example does not work

* chore: Move nested_lambdas.carp back to examples

* chore: Remove .DS_Store files

* fix: Bring back unicode test

* test: Make sure benchmark compile (had to remove mandelbrot and n-bodies)

* fix: Replacement implementation of clock_gettime on Windows

* chore: Trigger CI

* fix: Define CLOCK_REALTIME

Co-authored-by: Erik Svedang <erik@Eriks-iMac.local>
2020-11-23 06:30:43 +01:00
Tim Dévé
4f66803ab7
Updates mutual recursion example (#983)
so it can be executed without blowing the stack.
2020-11-20 15:12:49 +01:00
Erik Svedäng
e4acfe420e refactor: Clean up reptile code 2020-11-20 08:04:33 +01:00
Erik Svedäng
ad70be5023 refactor: Move logos into resorces directory 2020-11-20 07:52:59 +01:00
Erik Svedäng
526a5c1573 test: Add test for building empty project 2020-11-11 07:10:59 +01:00
Basile Pesin
dd6d3e9008 Fixed lambda capture in presence of let bindings 2020-06-15 21:44:11 +02:00
Scott Olsen
b61a439e29 Update test to account for constrained interfaces
Constrained interfaces require little change to core carp. In rare cases
(illustrated in test/interfaces.carp) we need to make our functions
slightly more specific. This weakens inference slightly, but in my
opinion is a reasonable case of weakness and not a fault of the type
system.

Exceptional cases that were typed `a-> a` that is, cases that relied on
the previous typing errors related to interfaces, as might be expected,
no longer work (as is the case for the higher-order use of fmap in
examples/functor.carp).

Aside from that, nothing changes.
2020-06-01 23:39:19 -04:00
Basile Pesin
fd267015e9 Added a main to the example to not trip windows CI 2020-05-28 20:38:14 +02:00
Basile Pesin
4ab29d84ac Fixed the issue with nested capture and nested lambdas 2020-05-28 20:05:27 +02:00
Erik Svedäng
bbb7920332
Merge pull request #815 from hellerve/veit/fix-776
Make Array.range safe
2020-05-26 20:55:16 +02:00
hellerve
be8424657d core: rename unsafe-range to range-or-default 2020-05-24 12:26:18 +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
Erik Svedäng
e4e3c4208a
Merge pull request #790 from hellerve/veit/safe-num-from-string
Make Num.from-string better
2020-05-12 23:04:00 +02:00
hellerve
c569666a0a core: make from-string better 2020-05-12 22:33:40 +02:00
Erik Svedäng
dcca7505d1
Merge pull request #786 from hellerve/veit/move-to-templates
Move templates out of the compiler into deftemplates
2020-05-12 22:24:54 +02:00
hellerve
5667cf4738 no core example: fix load 2020-05-12 22:06:27 +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
hellerve
fce423aee9 core: move as many templates as possible out of the compiler 2020-05-12 12:44:17 +02:00
Jorge Acereda
c6bcd67523 Allow unicode identifiers 2020-05-11 16:10:41 +02:00
Jorge Acereda
9b08b6df3c Merge 2020-05-11 16:10:35 +02:00
Scott Olsen
f13a2fdd9d Add some more calls to implement to make tests pass 2020-05-10 13:32:22 -04:00
Erik Svedäng
83b8b1dbed Bug example. 2020-05-05 15:48:56 +02:00
Erik Svedäng
6f70dbd18e Merge branch 'master' into match-on-refs 2020-05-05 13:57:58 +02:00
Erik Svedäng
e288381a6d Bug explanation. 2020-05-04 15:09:44 +02:00
Erik Svedäng
3243a9fe73 Identified new problem. 2020-05-04 13:12:50 +02:00
Erik Svedäng
8462412d55 Remove solved bug code. 2020-05-04 12:48:56 +02:00
Erik Svedäng
5ebd1abcc8 Bug is fixed, tests run. 2020-05-04 11:50:49 +02:00
Erik Svedäng
854a93c07e This fixes the returing-a-ref bug for inner forms, defns still don't work. 2020-05-04 10:10:22 +02:00
Erik Svedäng
e79bfc9359 Remove solved bug. 2020-04-30 15:28:47 +02:00
Erik Svedäng
234aa9fe60 One more test. 2020-04-30 12:56:04 +02:00
Erik Svedäng
4988b40945 Nested sumtypes work with match-ref too. 2020-04-30 12:42:23 +02:00
Erik Svedäng
f006e6ed75 More advanced example (nesting does not work yet). 2020-04-30 11:42:31 +02:00
Erik Svedäng
9a3aa2d130 Matching on refs generates correct C. 2020-04-30 11:20:05 +02:00
Erik Svedäng
14111d00f9 Prep. 2020-04-29 16:46:56 +02:00
Erik Svedäng
3f132604f6 Added a variation on match; match-ref. 2020-04-29 15:19:11 +02:00
Erik Svedäng
6f692e93a8 Working on match. 2020-04-29 14:39:03 +02:00
Erik Svedäng
7b65d888f3 Some tests for nested sumtypes. 2020-04-29 13:55:31 +02:00
Erik Svedäng
abe61691a3 Nested sumtypes work. 2020-04-29 13:44:13 +02:00
Erik Svedäng
e96259fe7e Merge branch 'master' into match-on-refs 2020-04-29 11:35:36 +02:00
Erik Svedäng
ed071835d1 Remove bad example. 2020-04-29 11:29:39 +02:00
Erik Svedäng
2ccda81c23 Problematic test. 2020-04-29 10:54:41 +02:00