Fork me on GitHub
#hyperfiddle
<
2024-02-09
>
Vincent03:02:17

is there an e/for ?

henrik07:02:40

Same as calling for-by with identity

Vincent15:02:38

could you show me a verbose equivalence please

henrik15:02:07

Sure: (for-by identity [x y] …). You can also read the source:

(defmacro for
  {:style/indent 1}
  [bindings & body]
  `(hyperfiddle.electric/for-by identity ~bindings ~@body))
As you can see it’s just calling for-by.

👍 1
Vincent03:02:46

each item in coll ought be reference-able and therefore for-by makes more sense to me also

Vincent03:02:08

(extracting props from the identity case was nonobvious and is still opaque 😅 )

henrik08:02:52

The identitycase does have use-cases, such as when iterating through a sequence of IDs, or other things that are expected to be unique and stable (a range, for example). Still, it’s better to be explicit about it.

Vincent10:02:13

I'm adding :as to my destructurings so I can pass the whole item to the next layer

s-ol20:02:11

I have a history implementation based on electric goog history but navigation isn't working properly anymore. From breakpoints in closure library JS it seems as though new-goog-history might be getting called too often (maybe every time !history is referenced in a new context?)

s-ol21:02:52

seems that moving the value part of those two definitions out into nested (binding [...]) expressions (since they refer to each other) makes it work as it used to pre-IC

Dustin Getz18:02:42

could be a regression IDK i logged a ticket to take a closer look in the next couple weeks when we re-release the next set of demos in electric-fiddle

Dustin Getz18:02:28

at a very quick glance it looks like a known regression in resolving e/def that I don't think we addressed yet