DeltaStreams file-out format and class model
Bert Freudenberg
bert at freudenbergs.de
Wed Oct 10 08:37:44 UTC 2007
On Oct 10, 2007, at 7:15 , Keith Hodges wrote:
> If I recall correctly the default behaviour begins such that the first
> chunk is read and evaluated by the compiler, the result being a reader
Not quite. A chunk is everything up to the next bang (!). A chunk is
simply evaluated. Only if an empty chunk is seen, i.e., it starts
with a bang, the next chunk is taken as a reader definition.
> which (by convention) reads the next chunk and so on. Typically when a
> reader finds an empty chunk it returns, resetting to the initial
> reader
> which restarts the process.
For source code readers, yes.
> chunks can include encoded
> binary data if preceded by the appropriate decoding reader.
It can even be raw binary data, not encoded. It's the reader's
responsibility to deal with what follows.
> A header chunk, to set up the SystemEditors, one for the forward
> direction one for the reverse (although I suspect it may be
> possible to
> have one do both.)
>
> ! CurrentSystemEditor value: SystemEditor new. ! !
No, that would be a reader chunk. The correct way is
CurrentSystemEditor value: SystemEditor new. !
> Action Chunks.
>
> ! CurrentSystemEditor value addInstVarName: 'a' ! ! "individual
> statements"
> ! CurrentSystemEditor value inverseEditor removeInstVarName: 'a' ! !
Again - you should use plain chunks for that, not reader chunks.
> Although many may not agree with me I think there is a lot of
> potential
> for innovation using the chunk format, and it has the advantage that
> most people have the tools to read it already.
It's incredibly flexible indeed, and goes back to the B5000 that
inspired Smalltalk.
- Bert -
More information about the Squeak-dev
mailing list
|