On Mar 21, 11 07:41, bearophile wrote:
KennyTM~:
And this change makes integers look like they are iterable,
That's not so good, I agree :-)
This makes 'if' looks like a template :p.
I agree, that may cause troubles in D. Not good.
Yeah this was tried once and becomes a mess in detail :)
I remember part of the discussion, and I think it's a not so messy situation. I
think it's doable.
So how Archetype deals with 0 and 1-tuple?
I don't know, I presume as Python. In that discussion I said to Walter than the
1-tuple cause problems in Python. In the meantime I have changed my mind a bit:
1-tuple syntax in Python is not great, but it's much better than not having
tuple syntax :-)
I agree.
'yield' is gogreatod.
I have no idea what 'gogreatod' means, sorry :-)
An attempt to replace 'good' with 'great' which failed ;)
This could be a library type (as proposed before?)
Right.
the problem is to let the compiler knows the value-range in the propagation.
Right...
Yes. Maybe the Python/Javascript 1.7-like syntax
a = (f(x,y,z) foreach(x,y; it) if(cond(x,y)) foreach(z; it2) ...)
Yes please.
Plus the eager version too that produces an array:
[f(x,y,z) foreach(x,y; it) if(cond(x,y)) foreach(z; it2) ...]
Since this is an O(N) operation I don't see any reason an operator-based
syntax will be allowed, given 'in' is rejected for this reason.
I don't agree. "in" was refused for the linear search because elsewhere the D "in" is
known to be O(1). But D operators are generally allowed to perform O(n) operations too, think about the
"a[]-10" vector operation.
Though they have a [] to signify it's a vectorized operation. I mean
bare operation like 'a - 1'. (Also, using '-' makes it confusable with
'a[] - 1', the reason why '~' was created instead of overloading '+')
Hundreds could be>> 100 :)
Noam Chomsky is a genius and you must listen to him even when he's drunk :-)
Bye,
bearophile