diff options
| author | Omar Rizwan <omar@omar.website> | 2023-02-05 19:49:35 +0000 |
|---|---|---|
| committer | Omar Rizwan <omar@omar.website> | 2023-02-05 19:49:35 +0000 |
| commit | 6e0dcf02a5b29870f56d0abcdda3cdcf12e4fdfa (patch) | |
| tree | 8530279a57cdc284ce80864becc7e00e0d73631c /lib | |
| parent | c-statements: WIP checkpoint on statement removal (diff) | |
| download | folk-6e0dcf02a5b29870f56d0abcdda3cdcf12e4fdfa.tar.gz folk-6e0dcf02a5b29870f56d0abcdda3cdcf12e4fdfa.zip | |
c-statements: Use semi-opaque stmt & match handles, not bare indices
I want the extra bit of type safety to help me debug with-all. Also
fixes up cffi/tcl array support a bit
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/c.tcl | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -241,15 +241,16 @@ namespace eval c { }] variable argtypes - set argscripts [list] ;# TODO: return a dictionary + set argscripts [list {$argtype $argname;}] foreach {fieldtype fieldname} $fields { lappend argscripts [csubst { Tcl_Obj* obj_$fieldname; Tcl_DictObjGet(interp, \$obj, Tcl_ObjPrintf("%s", "$fieldname"), &obj_$fieldname); }] - lappend argscripts [arg $fieldtype \$argname.$fieldname obj_$fieldname] + lappend argscripts [arg $fieldtype \${argname}_$fieldname obj_$fieldname] + lappend argscripts [subst {\$argname.$fieldname = \${argname}_$fieldname;}] } - argtype $type [list expr [list [join $argscripts "\n"]]] + argtype $type [join $argscripts "\n"] variable rtypes rtype $type { |
