Is there a function to get the parent of an object for example
parent-of system/console/history
would give
system/console
Is there a function to get the parent of an object for example
parent-of system/console/history
would give
system/console
It seems that you don't realise that a path! value is a type of series! value:
>> path: 'system/console/history
== system/console/history
>> type? path
== path!
>> series? path
== true
So just remove the last value in the series:
>> path: head remove back tail path
== system/console
Peter is right if the history object has just one parent. But it may have others:
my-block: copy []
append my-block system/console/history
my-object: make object! [history: system/console/history]
history is now has three legitimate parents:
Which you consider to the the real parent is really up to you. There is no easy way that I know of to find all the contexts an object (or block) is part of.