Commit Graph

39 Commits

Author SHA1 Message Date
Veit Heller
d3a6ca562f
docs: document core modules (#1271) 2021-07-05 14:48:35 +02:00
hellerve
06607c2203 core: make bit-* interfaces 2020-07-08 21:11:28 +02:00
Scott Olsen
f13a2fdd9d Add some more calls to implement to make tests pass 2020-05-10 13:32:22 -04:00
scottolsen
040e9e4391 Add an implements primitive, update core
This change adds a new primitive Implements which changes interface
implementations from being implicit to being explicit. Going forward,
users will have to declare (implements <interface> <implementation>) to
explicitly add a function to an interface. This provides two benefits:

- Prevents unwitting name clashes. Previously, if one defined a function
  that happened to have the same name as an interface, it was
  automatically assumed the function implemented that interface when this
  is not always the intention, especially in large programs.
- Name flexibility. One can now implement an interface with a function
  that has a different name than the interface, which allows for greater
  flexibility.

I've updated core to make the necessary calls to the new primitive.

Since str and copy are derived automatically for types, we treat these
functions as a special case and auto-implement the interfaces.
2020-05-09 12:59:47 -04:00
Jorge Acereda
7b7cb5d1e5 Substitute /= interface by a generic. 2019-09-20 23:49:20 +02:00
hellerve
4bc9cb6046 core: make to-int and from-int interfaces 2019-03-26 18:08:17 +01:00
hellerve
6e685fc0d6 core: fix Int.MAX and Int.MIN referenes 2019-02-28 15:00:21 +01:00
Joel Kaasinen
cfb61847cb fix Map and Set behaviour for negative hash values
fixes #335

- add new Int.positive-mod function
- use it for Map and Set operations
- add tests
2018-12-01 18:01:02 +02:00
Erik Svedäng
1079075637 Various tweaks. 2018-06-01 16:40:14 +02:00
Erik Svedäng
12dbe36adc Added function 'zip' and 'enumerated' for Array. 2018-06-01 11:18:34 +02:00
hellerve
032249b342 core: add random module (referencing #227) 2018-05-22 19:34:38 +02:00
hellerve
db0a3d4417 core: document integer, interfaces, pattern, safeint, and system 2018-05-12 16:08:48 +02:00
hellerve
e3c1a31ec6 core: add neg protocol and add to int and long 2018-05-07 21:57:15 +02:00
Erik Svedäng
d84ea0cb31 /= for int refs 2018-04-24 10:57:58 +02:00
Erik Svedäng
ef1549250f More work on docs. 2018-03-27 09:43:39 +02:00
Erik Svedäng
4c8b661bdc Moved safe int functions into their own file that's not automatically loaded. 2018-03-06 16:44:07 +01:00
hellerve
01f366f2c8 core: remove interdependencies between modules 2018-02-27 15:10:42 +01:00
hellerve
b7ea8d1487 core: namespaced split-up carp headers 2018-02-27 15:08:39 +01:00
hellerve
f56b1ff93f core: split up core.h, installment 1 2018-02-27 15:08:36 +01:00
Erik Svedäng
9c7793d6d1 Undefine things until cl.exe can compile a Hello World program. 2018-02-12 14:34:17 +01:00
Erik Svedäng
26887f3716 Changed type signature of (set! ...) form. 2018-02-02 07:19:10 +01:00
Erik Svedäng
8281dfa109 Made inc, dec, max, min into interfaces. Changed Array.max/min to new
names. Fixed tests and removed special max/min from Statistics module.
2018-01-29 07:14:56 +01:00
Erik Svedäng
33aeab7c82 FIXED: Fails to find the correct Array.str when calling println* in a do-form. 2018-01-28 05:56:03 +01:00
Thomas Dendale
8d49d76279 Added clamp to Int too. Fixed random-between floating point exception when lower = upper.
Added Array.initialize, symbol? commands
2018-01-23 16:23:37 +01:00
hellerve
eba07aeb34 core: added numerical ref modules 2018-01-15 16:27:05 +01:00
hellerve
f93eb16615 core: add cmp interface; src: better sort 2018-01-15 16:10:11 +01:00
hellerve
7c9eaeac9f core: made format not leak memory; test: added test for format and fmt 2017-12-30 20:16:31 +01:00
hellerve
eccddd00fe format: added simple versions of format (work on issue #108) 2017-12-30 15:13:56 +01:00
Erik Svedäng
b0cdc65f4b Implemented 'add-ref' and 'zero' for Int/Float/Double. Allows nice 'Array.sum' function. 2017-12-04 07:21:35 +01:00
hellerve
fba4e8ba5e long & int: added binary arithmetic 2017-11-29 17:26:51 +01:00
hellerve
911076276e all: miscellaneous fixes 2017-11-29 15:28:21 +01:00
hellerve
b3d19ae9da int/long: added math functions 2017-11-17 12:26:01 +01:00
hellerve
40c19b138e int/long: added safe arithmetic 2017-11-16 21:19:39 +01:00
hellerve
631e2ab95f testing: added Test module 2017-10-23 16:07:54 +02:00
Erik Svedäng
b1f86624fb Allow &t instead of (Ref t) in type declarations. 2017-10-17 16:05:42 +02:00
Erik Svedäng
42874e6d57 Allow lambda ("λ") as an alias for Fn when defining types 2017-10-17 09:42:57 +02:00
Erik Svedäng
8cae7a7a3b A way to run all tests in one go. 2017-09-08 12:24:57 +02:00
Erik Svedäng
00cd8df5cf replicate & repeat generates deleter functions 2017-07-12 10:22:16 +02:00
Erik Svedäng
c80526cfaa REPLACE WITH HASKELL VERSION 2017-06-26 11:15:03 +02:00