mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
Bugs with foreach macro... :(
This commit is contained in:
parent
2237b955aa
commit
dc83ef1f36
@ -37,8 +37,5 @@
|
||||
|
||||
(defmodule Array
|
||||
(defmacro foreach [f xs]
|
||||
(list 'let
|
||||
(array
|
||||
'temp
|
||||
(list 'Array.transform f xs))
|
||||
())))
|
||||
(list 'for ['i 0 (list 'count (list 'ref xs))]
|
||||
(list f (list 'nth (list 'ref xs) 'i)))))
|
||||
|
@ -1,8 +1,4 @@
|
||||
;; This file contains examples of unsolved bugs
|
||||
|
||||
(use IO)
|
||||
|
||||
(use Int)
|
||||
(use Float)
|
||||
|
||||
(+ ?a ?b)
|
||||
(defn main []
|
||||
(Array.foreach println [@"A" @"B" @"C"]))
|
||||
|
@ -8,14 +8,4 @@
|
||||
(use Char)
|
||||
(use Bool)
|
||||
|
||||
(defn l [a b]
|
||||
(String.append @a @b))
|
||||
|
||||
(defn f []
|
||||
(let [strings [@"hej" @"san"]]
|
||||
(println (refstr &(reduce l @"START" &strings)))))
|
||||
|
||||
(defn main []
|
||||
;;(f)
|
||||
(while true (f))
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user