Tcl Library Source Code

View Ticket
Login
Ticket UUID: 58eb8d4e84c56705e6cec11f89a79f995ec53680
Title: Boolean type and a bug
Type: Bug Version:
Submitter: anonymous Created on: 2015-04-16 06:26:18
Subsystem: huddle Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2015-04-16 06:26:18
Resolution: None Closed By: nobody
    Closed on:
Description:
It would be interesting to add the boolean type to huddle. Specially for converting huddle objects to json.

Also inside the procedure "::huddle::_dict_setting", I think that the subcommand "create" is wrong:

"
        create { ; # $args: all arguments after "huddle create"
            if {[llength $args] % 2} {error {wrong # args: should be "huddle create ?key value ...?"}}
            set resultL {}
            foreach {key value} $args {
                lappend resultL $key [huddle to_node $value]
            }
            return [huddle wrap D $resultL]
        }
"

I would replace lappend with "dict set":
"            if {[llength $args] % 2} {error {wrong # args: should be "huddle create ?key value ...?"}}
            set resultL {}
            foreach {key value} $args {
                dict set resultL $key [huddle to_node $value]
            }
            return [huddle wrap D $resultL]
        }
"