[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax
From: |
Stephen Compall |
Subject: |
Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax |
Date: |
Tue, 13 Mar 2007 19:12:15 -0500 |
For the class pool/class instance divide, why not take advantage of
convention?
| InterROB protocolVersion dynamicInstance RecordNames |
where InterROB and RecordNames are class pool variables, and
protocolVersion and dynamicInstance are class instance variables.
On Tue, 2007-03-13 at 22:11 +0200, parasti wrote:
> Oh, you're right. I left class instance variables out of the picture.
> This is getting a bit confusing now... I was trying to figure out a way
> without hijacking the temporary variable declaration. I do think that
> it's better when all of the variables are explicitly declared instead of
> having their definitions being scattered all over the method definition
> scope. (Or scopes!) Well, class variables wouldn't, anyway. But I'd
> rather choose that than using the temporary variable declaration
> literal. I've gotten used to the idea that they're "temporary" and
> conceptually only exist during execution of something. A lifetime of an
> object seems far too different to be called "execution" of the object.
A recent example:
nextSkipUnrecognized: partialRecord
"Answer a block that will read the rest of partialRecord
and deliver the content as an UnknownRecordType."
| cont |
^cont := [:aConnection | | buffer |
buffer := aConnection receiveBuffer.
"I don't buffer the contentData myself, because it simply has
to be buffered, and it might as well stay in aConnection
receiveBuffer."
(buffer size - buffer position)
< partialRecord expectedDataSize
ifTrue: [cont]
ifFalse: [| content |
content := buffer next: partialRecord expectedDataSize.
aConnection receivedHandledUpToHere.
aConnection unknownRecordType:
(partialRecord withContentData: content).
self nextSkipPadding: partialRecord expectedPadding]]
Alternatively, using closures to persist tempvars is a perfectly
reasonable way to implement an object system. SICP includes an example.
--
;;; Stephen Compall ** http://scompall.nocandysw.com/blog **
"Peta" is Greek for fifth; a petabyte is 10 to the fifth power, as
well as fifth in line after kilo, mega, giga, and tera.
-- Lee Gomes, performing every Wednesday in his tech column
"Portals" on page B1 of The Wall Street Journal
signature.asc
Description: This is a digitally signed message part
- Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax, (continued)
- Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax, Mike Anderson, 2007/03/11
- Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax, parasti, 2007/03/11
- Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax, Paolo Bonzini, 2007/03/12
- Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax, parasti, 2007/03/12
- Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax, Paolo Bonzini, 2007/03/13
- Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax, Stewart Stremler, 2007/03/13
- Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax, Paolo Bonzini, 2007/03/13
- Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax, Stewart Stremler, 2007/03/14
- Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax, Mike Anderson, 2007/03/13
- Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax, parasti, 2007/03/13
- Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax,
Stephen Compall <=
- Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax, Paolo Bonzini, 2007/03/14
- Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax, parasti, 2007/03/14
- [Help-smalltalk] Re: [RFC] Smalltalk scripting syntax, Paolo Bonzini, 2007/03/15
- [Help-smalltalk] Re: [RFC] Smalltalk scripting syntax, parasti, 2007/03/16
- [Help-smalltalk] Directions for GNU Smalltalk (was Re: [RFC] Smalltalk scripting syntax), Paolo Bonzini, 2007/03/16
- [Help-smalltalk] Re: Directions for GNU Smalltalk (was Re: [RFC] Smalltalk scripting syntax), parasti, 2007/03/17
- Re: [Help-smalltalk] Re: Directions for GNU Smalltalk (was Re: [RFC] Smalltalk scripting syntax), Paolo Bonzini, 2007/03/18
- Re: [Help-smalltalk] Re: Directions for GNU Smalltalk (was Re: [RFC] Smalltalk scripting syntax), parasti, 2007/03/18
- Re: [Help-smalltalk] Re: Directions for GNU Smalltalk (was Re: [RFC] Smalltalk scripting syntax), Paolo Bonzini, 2007/03/19
- Re: [Help-smalltalk] Re: Directions for GNU Smalltalk (was Re: [RFC] Smalltalk scripting syntax), parasti, 2007/03/19