in reply to Re^4: more bracket chaos
in thread more bracket chaos

The example you gave does not demonstrate the need for this complexity. Find me an example where () is inside of <> (where swapping them would make things worse) and then we'll talk.

my current implementation converts all the brackets in any data file it loads before beginning its processing...

Sounds like you're saying "my design is poor because my implementation is poor"?!

Except the implementation is good, or at least on the right track. Convert (compile) then process (execute).

Replies are listed 'Best First'.
Re^6: more bracket chaos
by simonodell (Acolyte) on Aug 30, 2007 at 17:54 UTC
    (session add="username")<qd>username</qd>(/session)
    would result in the string "<qd>username</qd>" getting added to the session data under the tag username. this wouldnt happen with [ses<qd , <ses<qd or <ses(qd which would all work fine... <ses[qd would also break however [ses[qd and [ses(qd would work fine.

    its hard to think up examples of incorrect nesting, typically the brackets will all be < type and the normal nesting follows, the other two are just special cases where some bits of code have to be run out of the normal order. for instance a plugin to manipulate a server side file prior to allowing another plugin to read it and display its contents. (btw i got some nice caching on my implementation to avoid unneeded server disk writes) additional ; another thought;
    <case c="<mem>ref</mem>"> <1> (insertfile... </1> <2> (deletefile... </2> </case>
    this case statement does both cases before deciding which to do! if you turn the brackets around and give (case(mem, it works correctly.
      Why can't session get the username from the same place as qd does? It's really weird that it needs to be converted to ML and then back to a string.
        the modules are designed to work as independantly of each other as possible, the session var could be told
        <session add="foo"><qd>bar</qd></session> or <session add="foo"><case c="<qd>bar</qd>"> <refa>something</refa> <refb>something else</refb> </case></session> or <session <qd>ses_action</qd>="foo">some data</session> where ses_action is one of ; add ; del ; append etc
        </code>