From: KATO K. <k.k...@gm...> - 2008-04-21 23:22:03
|
I impremented a load/dump library for YAML. There are functional limitations with this module. load: - Node Anchors &anchor *anchor - multi line flow sequences/mappings - Multi-line Flow Scalars - Single/Double Quoted Scalars dump: - multi rank structures(list/dict) http://knivez.homelinux.org/~spro/tcl/yapt-0.1.tar.gz Comments? |
From: Jeff H. <je...@ac...> - 2008-04-22 04:21:22
|
KATO Kanryu wrote: > I impremented a load/dump library for YAML. > > There are functional limitations with this module. > load: > - Node Anchors &anchor *anchor > - multi line flow sequences/mappings > - Multi-line Flow Scalars > - Single/Double Quoted Scalars > dump: > - multi rank structures(list/dict) > > http://knivez.homelinux.org/~spro/tcl/yapt-0.1.tar.gz Thanks for this library. It looks good for a first pass. You do have some very odd coding constructs that should be corrected before release. I think this is good for 0.1 commit, then fix after. No offense intended, but it looks like a rough conversion from another language (Perl?), that isn't taking advantage of some of Tcl's advanced features. Some of the idiomatic changes needed: * Use foreach instead of for constructs for lists * Brace all expressions * Some 'concat's look like string appending is meant * Use 'eq' instead of string equal in exprs * Use 'string match' instead of -length in some cases * Is 'isAliasNode' an incorrect conversion from Perl RE? * Use 'string is bool' over lsearch of type - if valid. Regards, Jeff |
From: KATO K. <k.k...@gm...> - 2008-04-22 09:37:54
|
> Thanks for this library. It looks good for a first pass. > You do have some very odd coding constructs that should be corrected before release. Sorry, and Thanks. This library is my first lump of program in Tcl. So, there are many foolish logics in sourcecode, maybe. :( > I think this is good for 0.1 commit, then fix after. Supposing it is adopted, I will welcome. > but it looks like a rough conversion from another language (Perl?), That's right. The original library written in PHP. How to deal with container/structures differs considerably. Some amount of correction was made according to indication. http://knivez.homelinux.org/~spro/tcl/yapt-0.1.1.tar.gz > * Use foreach instead of for constructs for lists > * Brace all expressions All "twirl-variables" on foreach-idiom to be braced. But "for constructs for lists", I don't understand these concrete places. Can I trouble you to show me there. > * Some 'concat's look like string appending is meant > * Use 'eq' instead of string equal in exprs > * Use 'string match' instead of -length in some cases corrected > * Is 'isAliasNode' an incorrect conversion from Perl RE? now, "Alias Node" is no implemented in the library. So I comment outed the procedures.(and some not used) > * Use 'string is bool' over lsearch of type - if valid. It seems to be the treatment which is partly different. Tcl:([string is true/false $token]) 1 == {1 true yes or on} 0 == {0 false no off} YAML: 1 == {true on + yes y} 0 == {false off - no n} However, I am seldom scrupulous about this point... :) |
From: Andreas K. <and...@ac...> - 2008-05-22 19:25:15
|
This library (rev 0.2.2) has been added to Tcllib. Please welcome Kato Kanryu as the maintainer for that module. -- Andreas Kupries <and...@Ac...> Developer @ http://www.ActiveState.com Tel: +1 778-786-1122 > -----Original Message----- > From: tcl...@li... > [mailto:tcl...@li...]On Behalf Of KATO > Kanryu > Sent: Tuesday, April 22, 2008 2:14 AM > To: tcl...@li... > Subject: Re: [Tcllib-devel] YAML load/dump library > > > > Thanks for this library. It looks good for a first pass. > > You do have some very odd coding constructs that should be > corrected before release. > Sorry, and Thanks. > This library is my first lump of program in Tcl. > So, there are many foolish logics in sourcecode, maybe. :( > > > I think this is good for 0.1 commit, then fix after. > Supposing it is adopted, I will welcome. > > > but it looks like a rough conversion from another language (Perl?), > That's right. > The original library written in PHP. > How to deal with container/structures differs considerably. > > > > > Some amount of correction was made according to indication. > http://knivez.homelinux.org/~spro/tcl/yapt-0.1.1.tar.gz > > > * Use foreach instead of for constructs for lists > > * Brace all expressions > All "twirl-variables" on foreach-idiom to be braced. > But "for constructs for lists", I don't understand these concrete places. > Can I trouble you to show me there. > > > * Some 'concat's look like string appending is meant > > * Use 'eq' instead of string equal in exprs > > * Use 'string match' instead of -length in some cases > corrected > > > > * Is 'isAliasNode' an incorrect conversion from Perl RE? > now, "Alias Node" is no implemented in the library. > So I comment outed the procedures.(and some not used) > > > > * Use 'string is bool' over lsearch of type - if valid. > It seems to be the treatment which is partly different. > > Tcl:([string is true/false $token]) > 1 == {1 true yes or on} > 0 == {0 false no off} > YAML: > 1 == {true on + yes y} > 0 == {false off - no n} > > However, I am seldom scrupulous about this point... :) > > ------------------------------------------------------------------------- > 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 _______________________________________________ Tcllib-devel mailing list Tcl...@li... https://lists.sourceforge.net/lists/listinfo/tcllib-devel |