Re: [TCLCORE] TIP #317: Extend binary Ensemble with Binary Encodings
by Lars Hellstrom other posts by this author
May 5 2008 6:01AM messages near this date
Re: [TCLCORE] TIP #317: Extend binary Ensemble with Binary Encodings
|
[TCLCORE] TIP#316: Portable Access Functions for Stat Buffers
Pat Thoyts skrev:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Donal K. Fellows wrote:
> | Agreed. The way I read the TIP is that the formats are actually
> | sub-sub-commands. Plugging in new ones will just be a matter of creating
> | commands in the right namespace. (Probably.)
>
> Exactly. [binary encode] is a map ensemble with commands in
> tcl::binary::encode.
The kind of ensemble is a detail which it would be valuable to have in
the documentation. Extending a -map ensemble (as Pat hints at) is very
different from extending an ensemble built from exported namespace
commands (as Donal hints at). Coding a package that needs to extend an
ensemble with fallback code to handle every kind of ensemble (there are
at least three) is not fun.
Pat Thoyts skrev:
> | However, I think this would be an unnecessary complication. We have
> | other means of composing operations. ;-)
>
> This would be better handled using channels I think.
Strange that so many (I also got a mail off-list) should immediately
jump to channels when confronted with the idea of composing [binary
encode] formats.
For the record, then: The composition method I hinted at was of course
command substitution, as in:
binary decode flate [binary decode base64 $data]
Lars Hellström
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Tcl-Core mailing list
Tcl-Core@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-core
Thread:
Donal K. Fellows
Lars Hellstrom
Pat Thoyts
Donal K. Fellows
Kevin Kenny
Donal K. Fellows
Pat Thoyts
Lars Hellstrom
|