Oldes / Rebol-wishes

Repository for keeping Rebol related wishes out of issues
0 stars 0 forks source link

Wish: allow `none` value inside `map!` #21

Closed Oldes closed 3 years ago

Oldes commented 3 years ago

map! is often used to hold JSON data and loading a JSON with null will make the nulled value as deleted. Currently:

>> decode 'json {{"a":null}}
== #()

Red language already supports it:

>> load/as {{"a":null}} 'json
== #(
    a: none
)

https://github.com/Oldes/Rebol-wishes/issues/20 is required so one would be able to remove values from map when needed.

Oldes commented 3 years ago

Needs additional change in foreach native!

>> m: #(a 1 b 2 c #[none])
== #(
    a: 1
    b: 2
    c: none
)

>> foreach [k v] m [probe k probe type? v ()]
a:
integer!
b:
integer!
>>