While I agree with https://github.com/red/red/issues/2338 reasoning that object->map conversion is dangerous, at the same time from time to time I have to go through the odd object->block->map route (which is also lossy atm), and I remember it was being requested by others.
The use case rests on these issues:
objects are not extensible
maps do not evaluate the spec
So by writing
map: to map! to block! object [
func1: func [args] [body...]
...
]
I can create a set of functions (or objects with functions) that is safely extensible at runtime.
I've counted 8 occurrences of that in my code, and there's also sometimes a trick to make the spec more human-readable (but it's of low importance):
to map! to [] object [dec: sci: pct: none] instead of:
#[dec: #[none] sci: #[none] pct: #[none]]
Of course if we plan to make objects extensible, this would obsolete this wish.
While I agree with https://github.com/red/red/issues/2338 reasoning that object->map conversion is dangerous, at the same time from time to time I have to go through the odd object->block->map route (which is also lossy atm), and I remember it was being requested by others.
The use case rests on these issues:
So by writing
I can create a set of functions (or objects with functions) that is safely extensible at runtime.
I've counted 8 occurrences of that in my code, and there's also sometimes a trick to make the spec more human-readable (but it's of low importance):
to map! to [] object [dec: sci: pct: none]
instead of:#[dec: #[none] sci: #[none] pct: #[none]]
Of course if we plan to make objects extensible, this would obsolete this wish.