aiken-lang / aiken

A modern smart contract platform for Cardano
https://aiken-lang.org
Apache License 2.0
396 stars 82 forks source link

Allow complete patterns in args #955

Closed KtorZ closed 1 month ago

KtorZ commented 1 month ago

Some error examples too:

image image image
KtorZ commented 1 month ago

But one thing to consider is that Pattern::Var is also a thing.

That's a good point. The current args var do have one extra thing though which is: a label. That's really the only difference between the Pattern::Var and the current ArgName. That and how we explicitly distinguish Discarded for Named values for ArgName; which we rely on in a few places. I don't see reasons why it wouldn't work with Pattern::Var too but that's another layer of changes.

So, definitely a possible refactor, although it's not obvious whether it would actually make a lot of things simpler.

rvcas commented 1 month ago

it's not obvious whether it would actually make a lot of things simpler.

indeed :)