Skip to content

Implement Named Argument Passing #6

@z80dev

Description

@z80dev

Implement as a macro that just does syntax transformation

(defn foo [:address a b :uint256 x y] :internal :uint256
  (return (+ y (* x 4)))

could then be called with a dict obj of key-value pairs of named arguments and their values

(foo addr1 addr2 10 20)

(foo #{a addr1 b addr2 x 10 y 20})

;; can indent for clarity
(foo #{a addr1 
       b addr2 
       x 10 
       y 20})

alternative syntaxes could be

(foo @a addr1 @b addr2 @x 10 @y 20)

(foo {a addr1} {b addr2} {x 10} {y 20})

Metadata

Metadata

Assignees

No one assigned

    Labels

    dumb?might be a bad idea but lets not throw it away yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions