#113 ✓resolved
bahuvrihi

Join, Parser, Schema cleanup

Reported by bahuvrihi | October 13th, 2008 @ 08:16 AM | in Tap-1.0.0

These three were made ad-hoc and probably need a second thinking-though.

However, I don't think Join should contain the information to parse/format itself. While that would be handy, it's mixing contexts. Parser/Schema is only one use of Joins.

That being said, Parser/Schema should have a text-based way to specify an arbitrary Join class. Maybe a dot?


  --.type(*args)
  --.sequence(1,2,3,4)
  --.fork(3,1,2)

Looks pretty good.

Comments and changes to this ticket

  • bahuvrihi

    bahuvrihi February 14th, 2009 @ 05:05 PM

    Now that Join allows a multi-way join, there needs to be a multi-way syntax for specifying joins. Strictly speaking the merge and fork syntax (or even the sequence syntax) is no longer necessary. Still may be nice to keep them as they're expressive:

    
      --%[inputs][outputs]             # multi-way join
      --%Join::Class[inputs][outputs]  # generic join
    
  • bahuvrihi

    bahuvrihi February 15th, 2009 @ 11:26 PM

    This actually is necessary... current implementation has a hacky bugishness to format_x statements.

    
            def format_fork(source_index, outputs, options)
              "#{source_index[0]}[#{outputs.join(',')}]#{format_options(options)}"
            end
    

    source_index[0] ... how about just straight dumping of all source indicies that come in?

  • bahuvrihi

    bahuvrihi February 20th, 2009 @ 01:16 AM

    Moreover, bash has (suddenly?) decided to interpret the markup for merge and sync merge. None of this:

    
      % rap a -- b -- c --2{0,1}
      % rap a -- b -- c --2(0,1)
    
  • bahuvrihi

    bahuvrihi March 22nd, 2009 @ 09:29 PM

    Note that also (suddenly...) YAML decided to read in the sequence syntax improperly.

    
    - 1:0
    

    No go.

  • bahuvrihi

    bahuvrihi March 28th, 2009 @ 08:55 AM

    
    # = YAML Format
    #
    # - Hash is used in full format to specify node, join, round, prereq
    # - Array defines a node
    # - String defines a join, round, or flags a prereq same as on command line
    # - nils are removed before evaluation
    #
    # Order defines the order of nodes, and joins, etc are applied in
    # order with latter joins overriding the earlier joins in the case
    # of conflicts.
    
    - id: task
      config: {}
      args: []
    - join: class
      inputs: []
      outputs: []
      config: {}
    - round: n
      nodes: []
    - prerequisites: []
    
    # This format can be represented in a web form using the conventional
    # notation.  For example:
    #
    # schema[][id] = task
    # schema[][config][key] = value
    # schema[][args][] = a
    #
    # To ensure breaks between nodes, joins, etc, add a nil to the schema
    # array:
    #
    # schema[] = ~
    #
    # = Command Line
    #
    # The command line format specifies a subset of possible schema in
    # shorthand.  Nodes are represented as argvs, with any command line
    # switches included.  Joins, rounds, and prerequisites are specified
    # using strings added to option breaks.
    #
    # option                  -a, --a
    # node break              --
    # round assigment         --+, --++, --+n[p,q,r]
    # prerequisite assignment --*, --*[p,q,r]
    # join                    --.join[m,n,o][p,q,r]opts
    # (implicit join)         --.[m,n,o][p,q,r]
    # (implicit .join)        --n[p,q,r]
    #                         --[m,n,o]p
    #                         --n:m:o
    #                         --:
    #
    # In YAML, the joins are all possible and use the non-break string.
    # Note that Schema will always dump the most formal syntax, and some
    # constructs require quoting.
    
    - [name, arg, -a, --key, value]
    - - name
      - arg
      - -a
      - --key
      - value
    - 
    - +
    - ++
    - +1[1,2,3]
    - *
    - *[1,2,3]
    - .join[1,2,3][4,5,6]opts
    - .[1,2,3][4,5,6]
    - 2[4,5,6]
    - "[1,2,3]4"
    - "1:2:3"
    - ":"
    
    
  • bahuvrihi

    bahuvrihi April 17th, 2009 @ 11:57 AM

    • State changed from “new” to “resolved”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

A framework for making configurable, file-based tasks and workflows.

People watching this ticket

Tags

Pages