History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-903
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Rodrigo B. de Oliveira
Reporter: Rodrigo B. de Oliveira
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Allow 'of' to be omitted in type references when [] are used

Created: 26/Oct/07 07:20 AM   Updated: 28/May/08 01:11 PM
Component/s: None
Affects Version/s: 0.8
Fix Version/s: 0.8.3

Time Tracking:
Not Specified

Testcase included: yes


 Description  « Hide

I want to be able to write:

class Maybe[T]:
pass

class Some[T](Maybe[T]):
public value as T

class None[T](Maybe[T]):
pass

Instead of:

class Maybe[of T]:
pass

class Some[of T](Maybe[of T]):
public value as T

class None[of T](Maybe[of T]):
pass

All those 'of' are not necessary there for there's no ambiguity.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Avishay Lavie - 26/Oct/07 07:52 AM
IMHO, this gets us farther from Booishness and closer to C#-ity. I don't have an alternative though, but the "of" makes things so much more readable and more natural.

Also:

enum Age:
  Toddler,
  Child,
  Adolescent,
  Mature,
  Elderly

class Example:
  [property(List)]
  _list as (string)

  [property(Age)]
  _age as int

  def Method():
    something = List[Age]
    # do I mean self.List[self.Age], or typeof(List[of Age])?

certainly such morbid examples are far too common to allow this to take place


Cedric Vivier - 05/Feb/08 09:26 AM
I agree with Avish. It doesn't help readability and having several ways to write generic type references makes things confusing imho.

Greg Nagel - 11/Mar/08 05:59 PM
"[of X, Y Z]" still looks odd, though. Why not make it "of [X, Y, Z]"?

Greg Nagel - 28/May/08 01:11 PM
Er, ignore my last comment, but should this issue be closed?