Commit Graph

23 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
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
e4acfe420e refactor: Clean up reptile code 2020-11-20 08:04:33 +01:00
Erik Svedäng
6ddf0e8f2b FIX! Avoid having to use temporary variables to help lifetime
checker.

In Concretize.hs, 'manageMemory' visits all args BEFORE managing their variables, making
it possible to apply functions to args "at the same time" as passing
them to the function.

Example:

(let [n (Array.unsafe-nth &b idx)
  new-b (Bucket.shrink @n k)]
  (Array.aset b idx new-b))))))

becomes

(let [n (Array.unsafe-nth &b idx)]
  (Array.aset b idx (Bucket.shrink @n k)))))))
2020-02-07 16:01:33 +01:00
Erik Svedäng
576dad0984 Merge branch 'master' into lifetimez-with-lambdas 2019-11-25 12:22:04 +01:00
GrayJack
07def7db23 Fix all nth usage 2019-10-31 06:23:23 -03:00
Erik Svedäng
0c17dfe832 All tests run for real now. 2019-10-22 11:14:21 +02:00
hellerve
e24fd38258 sumtypes: multiple fixes
- add test suite for Result
- make Array a little safer overall
- document Maybe and Result comprehensively
- rework Array documentation
2019-02-15 10:24:47 +01:00
hellerve
8b6ab7357e core: refactor the vector module; generic types and use module system 2019-01-21 21:52:45 +01:00
Erik Svedäng
1dc8b536fc Deftype generates 'update' functions that expect refs to functions too. 2018-11-14 14:21:12 +01:00
Chris Hall
7c1dd210d7 Renaming: String.count -> String.length, Array.count -> Array.length
Issue #236
2018-05-23 10:03:42 +10:00
Erik Svedäng
83cf727133 Moved keycodes into submodule. 2018-03-26 13:52:34 +02:00
Erik Svedäng
415600eb87 Better support for choosing if you want to use callbacks or not. 2018-03-20 16:38:50 +01:00
Erik Svedäng
f2742fe032 Moved event-related things into a submodule. 2018-03-20 16:05:52 +01:00
Erik Svedäng
10c1b62767 All tests run again, can build "game", "ant" and "reptile". 2018-03-20 14:34:49 +01:00
Erik Svedäng
0f6574193f Proper SDL module added, examples updated to work with it. 2018-03-15 21:14:18 +01:00
Erik Svedäng
337039776e Set the project title for some of the examples. 2018-03-14 20:48:23 +01:00
hellerve
e8dd3f3e0f examples: fix reptile for new accessor functions 2018-02-05 10:22:15 +01:00
Erik Svedäng
26887f3716 Changed type signature of (set! ...) form. 2018-02-02 07:19:10 +01:00
Erik Svedäng
26187e9d86 Use 'add' instead of '+' for Vectors. 2017-12-18 22:46:52 +01:00
hellerve
e116224a46 examples: fixed reptile 2017-12-18 17:37:56 +01:00
Erik Svedäng
e37a3e679b s/import/use in carp files. 2017-09-06 10:05:19 +02:00
Erik Svedäng
2c672dd583 Half-done converting reptile.carp to latest version of Carp. 2017-06-27 14:57:16 +02:00