Forum OpenACS Development: nest tcl package

Collapse
Posted by Neophytos Demetriou on
I have just uploaded a package that implements a language on top of TCL. I was originally planning to use it for implementing persistence in OpenACS but the time has passed. The actual code does not exceed 500 lines including the DTD and the comments (less than 400 lines without the comments). Resulting spec can be validated with the DTD in the code using xmlint (did that already - just in a hurry to get some other work done right now).

I also plan to rewrite all of my other apps/packages on top of it. The resulting spec (tclsh read-nest.tcl message.nest) can be compiled into C code (while retaining the ability to function in TCL) just like I did with the templating more than a year ago.

You can find the "nest" package here:
http://www.openacs.org/file/4205606/nest.tar.bz2.bz2

You may find my templating presentation in EuroTCL 2013 relevant:
http://www.tcl.tk/community/tcl2013/EuroTcl/presentations/EuroTcl2013-Demetriou-WebTemplating.pdf

Apologies for cross-posting in OpenACS Q&A and OpenACS Development.

Collapse
2: Re: nest tcl package (response to 1)
Posted by Neophytos Demetriou on
Uploaded new version of the package as a minor bug that sneaked in the last minute ruined the show. You can follow the development of the package here: https://github.com/neophytos-sk/nest
Collapse
3: Re: nest tcl package (response to 1)
Posted by Neophytos Demetriou on
nest-0.5 released, same urls as above, just wanted to point out the definition of struct and pair in nest.

meta {nest} {nest {nest {type_helper}}} {struct} {
    varchar name
    varchar type
    varchar nsp

    multiple struct slot = {} {
        varchar parent
        varchar name
        varchar type
        varchar default_value = ""
        bool optional_p = false
        varchar container = ""
    }

    varchar pk
    bool is_final_if_no_scope

}

alias {pair} {lambda {typefirst typesecond name} {
    nest {type_helper} $name [concat $typefirst {first} " ; " $typesecond {second}]
}}

("before the chicken and the egg, it was the nest")
Collapse
4: Re: nest tcl package (response to 1)
Posted by Neophytos Demetriou on
nest-1.0 released (2014-11-30) - alias/forward, inst/decl mode, class/object aliases, struct/slot, template/pair - 322 lines of code

    alias {object} with_mode {inst} nest {type_helper}

    alias {class} with_mode {decl} nest

    meta {class} {class {object}} {struct} {
        varchar name
        varchar type
        varchar nsp
        varchar default_value = ""

        multiple struct slot = {} {
            varchar name
            varchar type
            varchar meta
            varchar default_value = ""
            bool optional_p = false
            varchar container = ""
        }

        varchar pk
        bool is_final_if_no_scope

    }

    template {pair} {typefirst typesecond} {
        ${typefirst} {first}
        ${typesecond} {second}
    } {type_helper}

PS. Before the chicken and the egg, it was the nest.