Introduce * (star) for declaring lists
Brought to you by:
bonniot
Nice already introduced the ? character for declaring
an option type. Like in DTD, you could introduce the
* for declaring a 'many' type.
Something like this:
class Order {
}
class Customer {
// a customer has many orders.
// this expands to:
// List<Order> _orderList;
Order* _orderList;
// Beside List, a set of items could also be
// addressed.
// this expands to:
// Set<Order> _orderSet;
Order% _orderSet;
}
One would say: "Eeek, this looks like C". And
surprise: It *is* C.
Since in C, a pointer to an order is identical with
an array of orders.
Logged In: YES
user_id=684961
I thought the option type referred to nullness, and I'm not
quite sure how this is relates to the proposed changes.
Also, I'm not sure why this feature request is in the
nicedoc category.
The suggested notation seems to me to simply be syntactic
candy, saving about 5 characters. I'm not sure that this
feature would really be add value.