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

Builders explicit build arg #328

Open
gavr123456789 opened this issue Dec 16, 2024 · 0 comments
Open

Builders explicit build arg #328

gavr123456789 opened this issue Dec 16, 2024 · 0 comments

Comments

@gavr123456789
Copy link
Owner

// was
builder Turtle repeat times::Int -> Turtle = [
  t = Turtle new
  times repeat: [
    build this: t
  ]
  ^t
] 

// new

builder Turtle repeat times::Int build::[Turtle -> Unit]-> Turtle = [
  t = Turtle new
  times repeat: [
    build Turtle: t
  ]
  ^t
] 
// call new
repeat(times: 5) build: [...]

So basically u just make receiver and build arg implicit in usual builders

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant