You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I agree with red/red#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.
The text was updated successfully, but these errors were encountered:
hiiamboris
changed the title
WISH: make object! <map>
WISH: make map! <object>
Aug 23, 2024
While I agree with red/red#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.
The text was updated successfully, but these errors were encountered: