Re: Replacement for lambda - 'def' as an expression?
"Terry Reedy" <tjreedy@udel.e du> writes:[color=blue]
> Are you claiming that including a reference to the more humanly readable
> representation of a function (its source code) somehow detracts from the
> beauty of the function concept?[/color]
Huh? Anonymous functions mean you can use functions as values by
spelling out their source code directly, instead of having to make a
separate reference and then pass that. There are times when the
separate reference is just clutter. It's less readable, not more readable.
[color=blue]
> Or are you claiming that binding a
> function to a name rather than some other access reference (like a list
> slot) somehow detracts from its conceptual beauty? Is so, would you say
> the same about numbers?[/color]
Yes, I would say the same about numbers; Python would suffer if users
were required to give a name to every number. I'd say
x = f(1, 3)
is much less ugly than
one = 1
three = 3
x = f(one, three)
I further don't see how the second example is more "readable" than the first.
"Terry Reedy" <tjreedy@udel.e du> writes:[color=blue]
> Are you claiming that including a reference to the more humanly readable
> representation of a function (its source code) somehow detracts from the
> beauty of the function concept?[/color]
Huh? Anonymous functions mean you can use functions as values by
spelling out their source code directly, instead of having to make a
separate reference and then pass that. There are times when the
separate reference is just clutter. It's less readable, not more readable.
[color=blue]
> Or are you claiming that binding a
> function to a name rather than some other access reference (like a list
> slot) somehow detracts from its conceptual beauty? Is so, would you say
> the same about numbers?[/color]
Yes, I would say the same about numbers; Python would suffer if users
were required to give a name to every number. I'd say
x = f(1, 3)
is much less ugly than
one = 1
three = 3
x = f(one, three)
I further don't see how the second example is more "readable" than the first.
Comment