maria icon indicating copy to clipboard operation
maria copied to clipboard

Error in Maria for Experts

Open chancyk opened this issue 6 years ago • 3 comments

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

chancyk avatar May 09 '18 04:05 chancyk

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)

daveliepmann avatar May 09 '18 12:05 daveliepmann

That worked. Thanks!

chancyk avatar May 13 '18 18:05 chancyk

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

joshuayoerger avatar Nov 22 '21 21:11 joshuayoerger

Is it safe to call this issue resolved?

avidrucker avatar Mar 20 '23 19:03 avidrucker

Yes, the gist now has the correct seq logic: https://gist.github.com/jackrusher/6b128001a8034401e76c8a44ca40e4ab#file-maria-experts-cljs-L53

daveliepmann avatar Mar 22 '23 07:03 daveliepmann