Hi Stephan

Like everything else in TW5, the filter syntax is open to change and
extension, but I'll try to explain the current situation.

The thing about filters in TW5 is that the syntax is designed not to be too
much like a conventional programming language. If it were, then it would
really only make sense to adopt JavaScript syntax, and be done with it.
Although JS syntax is familiar to programmers, it contains many gotchas for
beginners, and isn't particularly expressive for the simple cases.

Why is the (unary) operator "!" inside the brackets while the binary
> operator "+" is outside?
>

The plus applies to the entire run of filter operators that follows it,
rather than just the one it immediately precedes. So it is in a different
place to reflect its different scope.


> Also: Will there be brackets (or are there already?)
>

No, highly unlikely. As I say, the goal isn't to recreate a programming
language; I'd rather make it simpler for people with that level of
sophistication to safely drop down to JS when they need to.

A non-goal of TW5 is to re-invent Angular.js.


> I see
>
> [[one]] [[two]] [[three]] +[tag[tom]]
>
> Which I would understand as
>
> [[one]] [[two]] ( [[three]] +[tag[tom]]  )
>
> But in fact currently mean
>
> ( [[one]] [[two]] [[three]] ) +[tag[tom]]
>

That's correct.

May I also be nitpicking in that "+" in binary logic means "OR" and "*"
> means "AND" - at least that's what I think I remember because the algebraic
> 0+1 = 1 and 0*1 = 0 are similar to the logical 0 | 1 = 1 and 0 & 1 = 0.
>

I guess I was hoping that people would think of "+" as meaning something
like "accumulate", rather than "boolean or".


> Why not stick to the logic operators?
>

Because most people don't understand logic operators.


> ( [[one]] | [[two]] | [[three]] ) & [tag[tom]]
>

The concern with something like this is that now we've just reinvented a
weird syntax for JavaScript.

Sorry! I seem to be complaining too much. I didn't intend to write that
> much when I started. It just appeared to my while writing.
>

No worries it's good feedback - particularly since you accompanied the
critique with a concrete proposal; that's helpful and much appreciated.

Best wishes

Jeremy


>
>  --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWikiDev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/tiddlywikidev.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Jeremy Ruston
mailto:[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to