Skip to content

Allow generate to accept just a closure with a default value #12084

@NotTheDr01ds

Description

@NotTheDr01ds

Related problem

I might be getting ahead of myself, but with #12056 on the horizon, it would be nice to have generate support this feature.

Describe the solution you'd like

As mentioned in #11318 ...

> let fibGenerator = {
      |fib = [ 0,1 ]|
      {
          out: $fib.0,
          next: [$fib.1, ($fib.0 + $fib.1)]
      }
  }

> generate $fibGenerator | first 5
╭───┬───╮
 0  0 
 1  1 
 2  1 
 3  2 
 4  3 
╰───┴───╯

Describe alternatives you've considered

No response

Additional context and details

I believe #12083 would also be required in order for this to happen. Perhaps these should be combined, but I'm not sure - Leaving them as two requests for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions