code: function (block) {
              if ( (command[0] === ".") && (command.length > 1) ) {
                  fun = doc.commands["."];
                  propcommand = command.slice(1);
              } else {
                  fun = doc.commands[command];
              }
      
              if (fun) {
                  doc.commands[cmdname] = 
                      function (input, args, name, command) {
                          var doc = this;
                          var newargs; 
                          var push = Array.prototype.push;
                  
                          if (propcommand) {
                              newargs = [propcommand];
                           } else {
                              newargs = [];
                           }
                           push.apply(newargs, args.slice(0, arg));
                           newargs.push(block);
                           push.apply(newargs, args.slice(arg));
                  
                          fun.call (doc, input, newargs, name, command); 
                      };
                  gcd.emit("command defined:" + cmdname);
              } else {
                  var lasthand = function () {
                      fun = doc.commands[command];
                      if (fun) {
                          doc.commands[cmdname] = 
                              function (input, args, name, command) {
                                  var doc = this;
                                  var newargs; 
                                  var push = Array.prototype.push;
                          
                                  if (propcommand) {
                                      newargs = [propcommand];
                                   } else {
                                      newargs = [];
                                   }
                                   push.apply(newargs, args.slice(0, arg));
                                   newargs.push(block);
                                   push.apply(newargs, args.slice(arg));
                          
                                  fun.call (doc, input, newargs, name, command); 
                              };
                          gcd.emit("command defined:" + cmdname);
                      } else { // wait some more ? why
                          gcd.once("command defined:" + command, lasthand);
                      }
                  };
                  lasthand._label = "delayed command:" + command +
                      ":" + cmdname;
                  gcd.once("command defined:" + command, lasthand);
              }
          }
docs: closure