> -----Original Message-----
> From: Andrew Faulds [mailto:[email protected]]
> Sent: 25 July 2012 18:03
[...]
> Fact: Adding a new name for a special kind of function as a syntax
> construct is going to cost (possibly unnecessary) time and energy,
> because now you have functions, and weird things that look almost
> like
> functions but aren't and can only be used to make generators.
That looks to me like a perfect argument *in favour* of the
"generator" keyword! I'm a very literal kind of person, and I would
absolutely want "weird things that look almost like functions but
[...] can only be used to make generators" to be clearly labelled
as such without having to hunt through the body of the not-quite-
function.
The signposting needn't even be as in-your-face as a generator
keyword (either instead of or in addition to function): I could get
behind a variation such as:
function f($x, $y) yields {
...
yield $z;
...
}
Or even (stretching a bit to re-use an existing keyword!):
function f($x, $y) return {
...
yield $z;
...
}
Although I like the concept of generators, I would be -1 for any
implementation that doesn't differentiate them in some way from
regular functions.
Cheers!
Mike
--
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,
Portland PD507, City Campus, Leeds Metropolitan University,
Portland Way, LEEDS, LS1 3HE, United Kingdom
E: [email protected] T: +44 113 812 4730
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php