Autoscoping of constructors #8646
Replies: 5 comments 15 replies
-
One idea is to reuse .symbol syntax. It does seem to work for from Standard.Base import all
type X
A
B x
cons x:X = x.to_text
main = cons .A but it doesn't work for |
Beta Was this translation helpful? Give feedback.
-
Pull request is ready for your consideration. |
Beta Was this translation helpful? Give feedback.
-
Case Constructor PatternsWill there be any change to case f of
~Item p next -> if n % p == 0 then False else
if p * p > n then True else @Tail_Call iterate next
~Empty -> True but I guess that's not really feasible - we need exact identification of the constructor before matching anything and that wouldn't be possible. All we could match would be the name and arity of the constructor and that doesn't seem to be enough. |
Beta Was this translation helpful? Give feedback.
-
@farmaazon wrote:
|
Beta Was this translation helpful? Give feedback.
-
How does this relate to the current enso/distribution/lib/Standard/Base/0.0.0-dev/src/Meta.enso Lines 138 to 140 in e98306f |
Beta Was this translation helpful? Give feedback.
-
Do you remember how ugly it is to always prefix a constructor of a type with its type name? Always write something like:
Enso should do better! Let's discuss how to do it!
Beta Was this translation helpful? Give feedback.
All reactions