rant
rant copied to clipboard
Prototypes
Add support for prototype functions to map objects for OOP workflows, custom access logic, etc.
This is a WIP issue for ongoing design work on prototypes.
Getting and setting prototypes
Map prototypes can be retrieved and assigned with [proto]
and [set-proto]
respectively:
<$myobj = @()>
<$myproto = @(proto-method = [?]{foo})>
[set-proto:<myobj>;<myproto>]
[proto:<myobj>] # [map(1)]
Prototype methods
Elements of a map's prototype act like elements of the owning map.
<$myobj = @()>
<$myproto = @()>
[$myobj/test] { foo }
[$myproto/test] { bar }
[set-proto: <myobj>; <myproto>]
[myobj/test] # bar