Something still not right with givens

Here is my latest attempt to get rid of with in given, in order to smooth the discussion in the “other thread”. I think everybody will agree that extends makes most sense here:

given c extends C

The problem is with anonymous:

given extends C

Revolting might be the word (less so if we take given as a substantive but let’s ignore this for the moment). What if we take instance (is that a soft keyword ?) to fill the blank in the anonymous case:

given instance extends C
given instance [T : Ord] extends C[T]

A little strangeness to solve the bigger with strangeness…
Edit : or indeed underscore, just in the instance case:

given c: C // abstract
given c: C = new C // alias
given C = new C // anonymous
given c extends C // instance
given _ extends C // instance, anonymous

Edit2 : or maybe take instance also in the named case:

given c: C // abstract
given c: C = new C // alias
given C = new C // anonymous
given instance extends C
given instance c extends C // named

Credits : Feedback sought: Optional Braces

2 Likes