Skip to content

Text format: named expressions instead of push/pop? #693

Closed
@qwertie

Description

@qwertie

Reviewing this proposal I would propose, instead of a strict push-pop regime, a simple way of naming trees. That is, instead of

   push:0 call $foo($x)
   push:1 call $bar($y)
   call $qux(pop:0, pop:1)

let's use

   expr #0 call $foo($x)
   expr #1 call $bar($y)
   call $qux(#0, #1)

This is potentially better when writing code by hand because you can give a name to each subtree, and you can use a tree more than once:

```
expr #halve0 ($0 = $0 * 0x0.8p+0) // parens optional
call $foo(#halve0, #halve0)
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions