expr icon indicating copy to clipboard operation
expr copied to clipboard

Provide a way to define types via expr

Open antonmedv opened this issue 2 years ago • 1 comments

Now expr inherits types from "example" env. I may be cool to have a API to define types explicitly.

antonmedv avatar Nov 27 '23 21:11 antonmedv

We can introduce those:

  • types.Map: for giving a hint of map fields.
  • types.StrictMap: field hints, plus only defined keys are allowed.

antonmedv avatar May 09 '24 07:05 antonmedv

This would be a great feature. Any plans of implementing this?

staugaard avatar May 18 '24 03:05 staugaard

Yes, this feature on the roadmap.

antonmedv avatar May 18 '24 07:05 antonmedv

	env := types.StrictMap{
		"foo": types.StrictMap{
			"bar": types.Int,
		},
	}

antonmedv avatar Jun 04 '24 22:06 antonmedv