Commit Graph

68 Commits

Author SHA1 Message Date
Erik Svedäng
e40dfc57d7
Merge pull request #536 from scolsen/array-list-dynamics
Macros: Add dynamic list to array transforms
2019-09-09 21:43:04 +02:00
hellerve
a2c859c586 all: remove local-include in favor of relative-include 2019-09-09 17:56:43 +02:00
Scott Olsen
b9d792ae39 Macros: Implement hellerve@'s generic collect-into
This change removes the previous array/list transformation dynamic
functions in favor of a generic collection transform courtesy of
@hellerve.

I made one minor adjustment to make the api more friendly, namely, the
implicit introduction of quoting such that users do not have to do so
themselves.
2019-09-08 14:58:30 -04:00
Scott Olsen
9aa7e4c0cb Macros: Fix issue in array-to-list
In order to work properly, the list returned by the array-to-list
function needs to be quoted.

Additionally, I fixed an obvious error in which the wrong internal
function was called in array-to-list
2019-09-08 14:54:29 -04:00
Scott Olsen
a8751a712e Macros: Add dynamic list to array transforms
This change adds two utility functions to the Dynamic module for
transforming list forms into arrays and array forms into lists.

Using this function, one can easily convert lists and arrays for
ease of symbol manipulation, for example:

```clojure
(Symbol.join (list-to-array (list 'a 'b 'c)))
```

This comes in handy, for instance, when defining macros, as certain
forms in Carp expect arrays in certain places while others expect
list--this enables the programmer to flexible convert between the two as
needed.
2019-08-26 23:44:29 -04:00
Jorge Acereda
82bc16c809 More generic for macro 2019-07-09 00:18:38 +02:00
hellerve
f60f72f4b4 core: add todo macro 2019-06-22 20:18:32 +02:00
hellerve
465f34b7ff core: add annotations 2019-06-06 10:54:58 +02:00
hellerve
e9fcf87ff5 core: remove stringcopy.append 2019-05-27 18:05:44 +02:00
hellerve
3768c42d23 core: add const-assert 2019-05-22 20:01:03 +02:00
Scott Olsen
6819ab7707 Macros: Add defproject macro 2019-05-20 00:08:09 -04:00
hellerve
a1f5b1fc2f core: add while-do macro 2019-04-30 21:42:34 +02:00
Erik Svedäng
0049c13111 Renamed 'defdynamic' to 'defndynamic'. 2019-03-13 18:49:48 +01:00
Erik Svedäng
0671cfc6cf Fixes to be able to compile SDL example 2019-03-06 23:44:43 +01:00
hellerve
023dfa1ae3 all: make and and or macros 2018-09-23 09:34:38 +02:00
hellerve
cfee23c429 core: fix stray usage of outdated debug functionality 2018-09-19 17:53:09 +02:00
Erik Svedäng
7982057061 Tests run. 2018-06-15 14:46:44 +02:00
Erik Svedäng
8e1c8ce79a Rename variable to not clash with keyword 'fn'. 2018-06-15 12:07:32 +02:00
Chris Hall
7c1dd210d7 Renaming: String.count -> String.length, Array.count -> Array.length
Issue #236
2018-05-23 10:03:42 +10:00
Chris Hall
b46b2a39e8 String.append is now by reference, StringCopy.append is by copy/linear
Adding memory leak tests to String.append and StringCopy.append

Issue #94
2018-05-20 14:16:10 +10:00
Erik Svedäng
570ae954e2 Hidden bindings don't print with info command. 2018-03-27 14:21:12 +02:00
Erik Svedäng
c1e427688d Weird typos fixed. 2018-03-27 14:14:30 +02:00
Erik Svedäng
dd726410ed private? hidden? 2018-03-27 14:08:49 +02:00
Erik Svedäng
891b34f0d1 Sidebar. 2018-03-27 10:51:16 +02:00
Erik Svedäng
ef1549250f More work on docs. 2018-03-27 09:43:39 +02:00
Erik Svedäng
32eaae7a5c Pretty nice looking docs. 2018-03-27 09:05:58 +02:00
Erik Svedäng
95b74e4179 Can set and preserve meta before def/defn/defmacro/defdynamic. 2018-03-26 16:51:43 +02:00
Erik Svedäng
3d3b34f70f Bugfixes and cleanup of minimal example. 2018-03-24 16:28:35 +01:00
Erik Svedäng
07878fc4a9 Nicer event handling with the help of 'foreach' macro and 'SDL.Event.all' function. 2018-03-24 11:17:56 +01:00
Erik Svedäng
6279d46bc0 'load-and-use' macro 2018-03-24 10:28:19 +01:00
Erik Svedäng
b55bdd8e38 Preparations for making assert macro work. 2018-03-13 10:16:48 +01:00
Erik Svedäng
832212d3fe The 'relative-include' macro works. 2018-03-13 09:36:18 +01:00
Erik Svedäng
ac6afff264 Started working on 'relative-include' macro - not working yet though. 2018-03-12 16:30:36 +01:00
Erik Svedäng
fcc01ff268 Some new functions and macros. 2018-03-11 14:53:50 +01:00
Erik Svedäng
2aa4a1a5c0 'eval' macro for easy printing of (compiled) values in the REPL. 2018-03-04 11:41:47 +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
0610c8e209 BUGFIX: Memory allocated in the condition of a while-loop is managed
first run through the loop.
2018-02-08 18:34:53 +01:00
Erik Svedäng
74d4025223 Put the c[ad]r dynamic functions into the Dynamic module. 2018-02-08 17:39:42 +01:00
Erik Svedäng
26887f3716 Changed type signature of (set! ...) form. 2018-02-02 07:19:10 +01:00
hellerve
27a4a3edff core: fix bench and ignore form, because they were buggy 2018-02-01 18:01:45 +01:00
hellerve
9a3b0e5f59 bench: added first bits of benchmarking 2018-01-25 17:26:20 +01:00
Thomas Dendale
24d6e625e6 Fix for macro when body is empty 2018-01-17 17:08:02 +01:00
Thomas Dendale
5480f5277a Print macro error (warning) when using more then one expression in body 2018-01-17 16:12:25 +01:00
hellerve
d32fe4102f core: added a few more functions to stdlib 2018-01-02 18:13:52 +01:00
hellerve
a048d2f931 core: added and*, or*, str*, and println* macros 2017-12-29 11:49:51 +01:00
hellerve
9e60ff01c1 core: fixed statistics cond and tests; core: accurate error message on cond 2017-12-15 17:43:06 +01:00
hellerve
1deb64722a core: fix rebase error 2017-12-15 09:28:14 +01:00
hellerve
ffe4913a29 core: added suggestions of @eriksvedang to new macros 2017-12-15 09:27:06 +01:00
hellerve
0ad340ad55 core: added useful macros to the standard library 2017-12-15 09:26:21 +01:00
hellerve
5b08413aa2 macros: added unless 2017-12-13 12:34:14 +01:00