Elektrine lite

← Feed

@numeredevs@fosstodon.org

2026-07-22 19:14 UTC

@loke@functional.cafe @jwildeboer@social.wildeboer.net It's so interesting that you share the same issues with the (as we call it) default values of arrays. We had a time, when we set it to 0, then we made it depending on the operation and now we have a "neutral value", which looks like "void" ("null" n APL, as I understand it), but actually is considered to be neutral in every operation. And still, sometimes it does silly things. It is so hard to find a good compromise that works in all situations

Replies (1)

  • @loke@functional.cafe 2026-07-22 19:22

    @numeredevs@fosstodon.org @jwildeboer@social.wildeboer.net indeed. That's why I went for the selectable full value idea (not really my idea. J had it first I think). The default is 0 simply because I never considered anything else. Now, in Kap, null has some of the properties you mentored. Adding any value to null returns the same value. The same goes for multiplication. Also when given a the right argument to subtraction and division. It has similar behaviour for functions where it makes sense. However, this behaviour of null for scalar operations was implemented as an experiment, and I'd still consider it experimental. Have you had good experiences with this kind of behaviour for null values? You mentioned it does silly things, do you mean unexpected results caused by this?

    Open ##5136249