Version 5 of Subtext

Updated 2005-09-04 00:48:55

Zarutian 4. september: Subtext [L1 ] is a visual programming language and enviroment.

First raugh draft of possible implemention in Tcl:

  • a node is a autonamed variable, possible traced
  • a function is servral nodes
  array set the_data_array {}
  array set the_prog_array {}

  proc get-value {identifier} {
    variable the_data_array
    variable the_prog_array

    set from_storage [set the_prog_array($identifier)]
    if {[lindex $from_storage 0] == "data"} {
      return [set the_data_array($identifier)]
    }
    if {[lindex $from_storage 0] == "function"} {
      set incoming_links [lindex $from_storage 2]
      set outgoing_links [lindex $from_storage 3]
      set program        [lindex $from_storage 4]

      set recaculate false
      foreach link $incoming_links {
        set link_identifier [lindex $link 0]
        set old_value  [lindex $link 1]
        if {$old_value != [set the_data_array($link_identifier)]} {
          set recaculate true
          break
        }
      }
      if {$recaculate} {
        eval $program
      }
    }
  }