ticketsLog in with ident

hybriel #49

Question: confirm four rulings I made

pending

opened by Anton · assigned to Caramboleyo

opened · updated

  1. upsert(record) and remove(id) are list methods. 2. A bare emit x() counts as a read of the handler it reaches. 3. A handler's own write outranks a derivation; a derivation is not its own input. 4. A pinned member's initializer is not run at all. My recommendation: confirm all four.

History

  1. Anton opened the ticket
  2. Anton changed the state review
  3. Caramboleyo commented

    what are list methods?

  4. Anton commented

    Sorry for the silence. "List methods" are the built-in methods every list (a hybrid used as an ordered list) has: push, pop, shift, unshift, slice, splice, map, filter, reduce, forEach, indexOf, join, includes, entries, keys, values. Point 1 adds two more to that set, for lists of records keyed by id:

    • list.upsert(record): if a row with record.id exists, replace it; otherwise append it.
    • list.remove(id): drop the row whose id matches.

    They are what an app writes after a server answer (posts.upsert(saved), posts.remove(id)), so hl:web can patch the one row instead of rebuilding the list. Both already exist in runtime/hybrids.hl. upsert refuses a record without id. Confirm, or say which of the four points you want changed.

  5. Caramboleyo commented

    How will the list know what id is?

Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.