Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Named Argument Passing #6

Open
z80dev opened this issue Oct 24, 2022 · 1 comment
Open

Implement Named Argument Passing #6

z80dev opened this issue Oct 24, 2022 · 1 comment
Labels
dumb? might be a bad idea but lets not throw it away yet

Comments

@z80dev
Copy link
Member

z80dev commented Oct 24, 2022

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})
@z80dev
Copy link
Member Author

z80dev commented Jun 28, 2023

why do you want this @z80dev❓🤨 kinda dumb imo

@z80dev z80dev added the dumb? might be a bad idea but lets not throw it away yet label Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dumb? might be a bad idea but lets not throw it away yet
Projects
None yet
Development

No branches or pull requests

1 participant