Elektrine lite

← Feed

@loke@functional.cafe

2026-07-22 13:08 UTC

@numeredevs@fosstodon.org @jwildeboer@social.wildeboer.net that's true. The behaviour I described was caused by the specific method I chose to parse the data (manual splitting). I have to admit not reading the specification, which I presume would mention the existence of blank state vectors. The 'proper' way to parse this based on my assumptions would be to use a regex to break out the components and then parse them as numbers. The regex match would then fail on an invalid string. This is actually what I usually do, but the manual solution showed off more of the array manipulation primitives in Kap compared to a simple call to regex:match. reference.html#_regexmatch_match_string_against_regex (and now I realise that I should document those functions more than just listing their names).

Replies (1)

  • @numeredevs@fosstodon.org 2026-07-22 15:22

    @loke@functional.cafe @jwildeboer@social.wildeboer.net I don't want to start a philosophical discussion about that and it's still only a recommendation, but my point was more about this statement: "Any elements that are shorter gets filled in with the fill element, which is 0 by default." An empty list is closely related to an empty set and I do not think that there is a bijection between that and one or more zeros, i.e. yo cannot undo the operation. Therefore I'd consider using NaN or something like "void" as default instead.

    Open ##5136246