Skip to content

Commit 36fab5c

Browse files
committed
Use toolz.concat.
1 parent 86b0915 commit 36fab5c

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

simalq/tile/monster.hy

+1-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@
418418
:points-for-generator (classmethod (fn [cls] ~points-gen))
419419
:flavor ~flavor-mon
420420
:flavor-for-generator ~flavor-gen
421-
~@(sum :start [] (gfor
421+
~@(hy.I.toolz.concat (gfor
422422
[k v] (.items kwargs)
423423
[(hy.models.Keyword k) v])))
424424

simalq/tile/tilepedia.hy

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
(import
5+
toolz [concat]
56
metadict [MetaDict]
67
simalq.color
78
simalq.game-state [G]
@@ -97,9 +98,9 @@
9798
:href (+ "#" tile.id)))))))))
9899

99100
; One section of info screens per superclass
100-
#* (cat (gfor
101+
#* (concat (gfor
101102
[superclass-name tiles] (.items info)
102-
[(E.h2 superclass-name) #* (cat (gfor
103+
[(E.h2 superclass-name) #* (concat (gfor
103104
; One info screen per tile type
104105
tile tiles
105106
[(E.h3 (mapsym tile) tile.long-name :id tile.id)
@@ -131,9 +132,5 @@
131132
(if self-closing "" f"</{(hesc tag)}>")))
132133

133134

134-
(defn cat [l]
135-
(sum :start [] l))
136-
137-
138135
(when (= __name__ "__main__")
139136
(print (html)))

tests/lib.hy

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
(require
66
hyrule [do-n unless])
77
(import
8+
toolz [concat]
89
metadict [MetaDict]
910
simalq.geometry [Pos at Direction]
1011
simalq.un-iq [iq-quest]
@@ -82,7 +83,8 @@
8283
(hy.I.simalq/tile.Player :pos (Pos model player-x player-y)))
8384
(assert (= G.map.width model.width))
8485
(assert (= G.map.height model.height))
85-
(for [[stack-actual stack-expected] (zip (sum :start #() G.map.data) (sum :start #() model.data))]
86+
(for [[stack-actual stack-expected]
87+
(zip (concat G.map.data) (concat model.data))]
8688
(assert (= (len stack-actual) (len stack-expected)))
8789
(for [[t-actual t-expected] (zip stack-actual stack-expected)]
8890
(assert (= t-actual.stem t-expected.stem)))))

0 commit comments

Comments
 (0)