Bugs with foreach macro... :(

This commit is contained in:
Erik Svedäng 2017-10-17 09:25:30 +02:00
parent 2237b955aa
commit dc83ef1f36
3 changed files with 4 additions and 21 deletions

View File

@ -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)))))

View File

@ -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"]))

View File

@ -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))
)