Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Join, Parser, Schema cleanup

#113

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.

Reported by bahuvrihi · October 13th, 2008 @ 08:16 AM

State: resolved
Milestone: Tap-1.0.0
Assigned to: nobody

Activity

  1. bahuvrihi
    bahuvrihi

    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
    

    February 14th, 2009 @ 05:05 PM

  2. bahuvrihi
    bahuvrihi

    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?

    February 15th, 2009 @ 11:26 PM

  3. bahuvrihi
    bahuvrihi

    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)
    

    February 20th, 2009 @ 01:16 AM

  4. bahuvrihi
    bahuvrihi

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

    
    - 1:0
    

    No go.

    March 22nd, 2009 @ 09:29 PM

  5. bahuvrihi
    bahuvrihi
    
    # = 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"
    - ":"
    
    

    March 28th, 2009 @ 08:55 AM

  6. bahuvrihi
    bahuvrihi
    • State changed from new to resolved

    April 17th, 2009 @ 11:57 AM

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.