maria
maria copied to clipboard
Error in Maria for Experts
Issue:
Executing the block with:
(defcell a-color (interval 250 #(rand-nth (keys color-names))))
causes:
this.mseq.cljs$core$ISeq$_first$arity$1(...).cljs$core$IMapEntry$_key$arity$1 is not a function
Environment:
- Browser: Chrome 66
- Platform: Windows 10
You're absolutely right. This is due to a snafu with color-names
that we are deciding how best to resolve. For the moment you can work around it by changing
(keys color-names)
to
(map first color-names)
That worked. Thanks!
The work around above, (map first color-names)
, (currently) returns only the first letter of the color name so the circle is always black.
Turning color-names
into a sequence before calling rand-nth
seems to work though, so I thought I'd leave a note here.
(defcell a-color (interval 250 #(rand-nth (seq color-names))))
Is it safe to call this issue resolved?
Yes, the gist now has the correct seq
logic: https://gist.github.com/jackrusher/6b128001a8034401e76c8a44ca40e4ab#file-maria-experts-cljs-L53