Closed YuMingLiao closed 3 years ago
Hi @YuMingLiao !
I also had been thinking about an expression to TutorialD generator but was uncertain if it would be useful. Do you have a specific use-case you wish to address?
:showexpr true:{a:=false}
This was due to a bug in the boolean atom parser. Fixed in 28f5d1e4d868ca061f7e8b42688c6ed574f8c02b.
true == false
Relational equality is closed on the relational expressions.
TutorialD (master/main): :showexpr true = true
┌┐
││
├┤
└┘
true != false
Oops- the tutd parser neglected to include this operator. Fixed in f7fc88861d352a97cf2cbb477c02a2be18cce335.
:showexpr false:{a:=1}:{b:=1}
Indeed, Date has a quick fix for this which is implemented in a45300a7145884ef330e28aad2352a889bbda1dd:
:showexpr true:{a:=1,b:=1}
┌──────────┬──────────┐
│a::Integer│b::Integer│
├──────────┼──────────┤
│1 │1 │
└──────────┴──────────┘
:showexpr false:{a:=true}:{b:=@a}
This works now:
:showexpr true:{a:=3,b:=@a}
┌──────────┬──────────┐
│a::Integer│b::Integer│
├──────────┼──────────┤
│3 │3 │
└──────────┴──────────┘
Hi @agentm !
I also had been thinking about an expression to TutorialD generator but was uncertain if it would be useful. Do you have a specific use-case you wish to address?
What do you mean by "an expression to TutoiralD generator"? I wrote this prettyprinter just for me to understand constraints. It's hard to read ADTs directly. Now I know what it looks like in a relational expression. It use counts and != to make constraints.
Thanks for the fix and explanation!
I assume you made a function of type RelationalExpr -> TutorialDString
, right? I think that's a valuable improvement that could be used elsewhere, for example, to dump the database schema to a human-readable string.
I believe the tutd parsing issues in this ticket have been resolved. Please re-open if that is not that case.
I tried to write a prettyprinter for relational expression. Can't wait to post the work-in-process.
TODO relation{}{} should be false. relation{}{tuple{}} should be true. That's easier to read.
what I think should be working in tutd but not.
TutorialD (master/main): :showexpr true:{a:=false}
TutorialD (master/main): true == false
TutorialD (master/main): true != false
Consecutive JOINs and EXTENDs. Not sure if it should be working. Right now, it is not unless there are parens.
TutorialD (master/main): :showexpr true{}{}
TutorialD (master/main): :showexpr false:{a:=1}:{b:=1}
New attribute names in EXTENDs earilier should be able to be found by @ later.
TutorialD (master/main): :showexpr false:{a:=true}:{b:=@a}
( I guess @ can be seen as a id function, and it gives you a function-derived atom. )any ideas?