A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

K

Kay Schluehr

Bruno said:
Just for the record : Ruby's code-blocks (closures, really) come from
Smalltalk, which is still the OneTrueObjectLanguage(tm).

IsTheOneTrueObjectLanguage(tm)ReallyCamelCased?
 
B

Bruno Desthuilliers

Kay said:
IsTheOneTrueObjectLanguage(tm)ReallyCamelCased?
ThatsAGoodQuestion.

DoYouMeanIsTheIdentifierTheOneTrueObjectLanguage(tm)CamelCasedOrIsTheObjectObjectBoundToIdentifierTheOneTrueObjectLanguage(tm)CamelCasedOrYetSomethingElse?
 
J

jmdeschamps

Bruno said:
ThatsAGoodQuestion.

DoYouMeanIsTheIdentifierTheOneTrueObjectLanguage(tm)CamelCasedOrIsTheObjectObjectBoundToIdentifierTheOneTrueObjectLanguage(tm)CamelCasedOrYetSomethingElse?
youGuysAreAllCrazyOrSomethingNicer(CrazyBeingANiceAttributeHere)(ButIDon'tKnowAboutSyncategoremasLikeParenthesisOrApostrophe)InCamelBackNotationWhichAsNothingToDoWithPolishReverseNotation)ThankYou

Jean-Marc
 
H

Hendrik van Rooyen

Bruno Desthuilliers said:
ThatsAGoodQuestion.
DoYouMeanIsTheIdentifierTheOneTrueObjectLanguage(tm)CamelCasedOrIsTheObjectObjec
tBoundToIdentifierTheOneTrueObjectLanguage(tm)CamelCasedOrYetSomethingElse?

IAmGladToSeeThisSterlingAttemptAtMinimisingTheEncodingSpaceAsTheSpaceCharacterNe
verImpartedAnyInformationAnywayHendrik
 
T

Theerasak Photha

DoYouMeanIsTheIdentifierTheOneTrueObjectLanguage(tm)CamelCasedOrIsTheObjectObjec
tBoundToIdentifierTheOneTrueObjectLanguage(tm)CamelCasedOrYetSomethingElse?

IAmGladToSeeThisSterlingAttemptAtMinimisingTheEncodingSpaceAsTheSpaceCharacterNe
verImpartedAnyInformationAnywayHendrik

BurnMeIfThisIsntTurningIntoCeeTwoWiki

-- http://www.c2.com/cgi/wiki?TheerasakPhotha
 
T

Theerasak Photha

Unlike Java, Python's first class functions and
methods are already highly useful for callback-based systems

Curious: how well does the use of returning inner functions work as a
strategy for providing effectively 'anonymous' callbacks? e.g.

def outer(x):
def inner(y):
...
return inner

-- Theerasak
 
P

Paul Boddie

Theerasak Photha skrev:
Curious: how well does the use of returning inner functions work as a
strategy for providing effectively 'anonymous' callbacks? e.g.

def outer(x):
def inner(y):
...
return inner

Well enough, I'd imagine. There may be people who resent having to use
a statement to create a block of code, especially one which defines a
local name (the horror!), but as the lambda replacement discussions
showed, a sub-statement code block doesn't necessarily have an
acceptable formulation in non-Lisp-like languages. Or, at least, people
struggled to find such a formulation in Python which didn't severely
affect readability, and there are people who regard even
uncontroversial but related things as list comprehensions as being much
less readable than most other constructs in the language.

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,043
Members
48,769
Latest member
Clifft

Latest Threads

Top