Skip to content

Prototypes #1

Description

@TheBerkin

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestprototypesRelated to Rant prototypesstubIssue needs expansion

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions