Elektrine lite

← Feed

@loke@functional.cafe

2026-07-22 19:22 UTC

@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?

Replies (1)

  • @numeredevs@fosstodon.org 2026-07-22 19:40

    @loke@functional.cafe @jwildeboer@social.wildeboer.net Those silly things have mostly two possible root causes: 1. they (rarely) contradict the user's expectations 2. they mess with the internal bytecode optimisation, where expressions with multiple operands are optimized to a single instruction, e.g. x+x is optimized to 2*x+0, i.e. an addition could be converted to a multiplication (don't ask for an actual example, I'd need to go trough my git commits to find one). But in general I'd consider them a valuable addition.

    Open ##5136250