metaeducation / rebol-issues

6 stars 1 forks source link

ALTER and BITSET! #422

Open rebolbot opened 16 years ago

rebolbot commented 16 years ago

Submitted by: Jerry

bc.. >> a: charset "A" == make bitset! #{00...40}

alter a 1 == true a == make bitset! #{40...40} ; alter a 1 \ Error <== I was hoping #{00...40}

p.

CC - Data [ Version: alpha 31 Type: Wish Platform: All Category: Mezzanine Reproduce: Always Fixed-in:alpha 88 ]

rebolbot commented 15 years ago

Submitted by: BrianH

Arguably, it is more appropriate for the ALTER function to work with bitset! than it is for it to work with the datatypes that it currently does. However, the case has not yet been made for ALTER in its current state to be included at all - it is just not used.

A possible justification for a function like ALTER (with a less-vague name) would be an atomic toggling set operation, for bitsets and set-like series (with unique values, etc.). The current ALTER is not atomic (multitasking-safe).

It would be a good idea to remove ALTER and replace it with an atomic native called TOGGLE.