> > > Why not:
> > > [MAKE RICH_EMPLOYEE = {EMPLOYEE WITH SALARY > 100000}]
[quoted text clipped - 21 lines]
> input of the media layer is necessarily a relation. The input of the
> logical layer may either be a relation or an attribute set.
I see what you're aiming for and I think that I agree with the syntax.
The example that introduced the confusion for me is this:
[MAKE VIP_MEMBER = {RICH_EMPLOYEE}]
where "RICH_EMPLOYEE" refers to a relation.
TroyK
Cimode - 12 Mar 2008 17:36 GMT
> > > > Why not:
> > > > [MAKE RICH_EMPLOYEE = {EMPLOYEE WITH SALARY > 100000}]
[quoted text clipped - 27 lines]
>
> where "RICH_EMPLOYEE" refers to a relation.
Yes, under this premise a relation is a synonym for type.
> TroyK
Cimode - 12 Mar 2008 18:33 GMT
> > > > Why not:
> > > > [MAKE RICH_EMPLOYEE = {EMPLOYEE WITH SALARY > 100000}]
[quoted text clipped - 29 lines]
>
> TroyK
Basically if I write down
1) [MAKE VIP_MEMBER = {RICH_EMPLOYEE}]
or
2) [MAKE VIP_MEMBER = {MEMBER RICH_EMPLOYEE}]
I am defining VIP_MEMBER as having one attribute of type RICH_EMPLOYEE
(named RICH_EMPLOYEE in case 1 or MEMBER_RICH in case 2) while if I
write
[MAKE VIP_MEMBER = [RICH_EMPLOYEE]] I am actually equating the
relation VIP_MEMBER and the relation RICH_EMPLOYEE. Both are in fact
valid. It just depends if we are working at relation level or at
attribute level.
TroyK - 13 Mar 2008 22:00 GMT
> > > > > Why not:
> > > > > [MAKE RICH_EMPLOYEE = {EMPLOYEE WITH SALARY > 100000}]
[quoted text clipped - 46 lines]
>
> - Show quoted text -
I think I'm getting tripped up over whether the declaration is of a
new relation (called VIP_MEMBER that has (a) one attribute that is a
relvar, or (b) one attribute that is a relation.
Is this syntax:
[MAKE VIP_MEMBER = [RICH_EMPLOYEE]]
a view definition, or an assignment?
By the way, I should have prefaced my first response to the thread
with the disclaimer that I'm by no means a language designer, so you
can feel free to take my comments with a grain of salt.
TroyK
Cimode - 13 Mar 2008 22:27 GMT
> > > > > > Why not:
> > > > > > [MAKE RICH_EMPLOYEE = {EMPLOYEE WITH SALARY > 100000}]
[quoted text clipped - 50 lines]
> new relation (called VIP_MEMBER that has (a) one attribute that is a
> relvar, or (b) one attribute that is a relation.
An un-ary relation is *de facto* is a type.
When using {}, (b) is correct
> Is this syntax:
> [MAKE VIP_MEMBER = [RICH_EMPLOYEE]]
> a view definition, or an assignment?
A relation level assignment. Not a view.
When running...
[MAKE VIP_MEMBER = [RICH_EMPLOYEE]] I am creating a new relation whose
body is independent from RICH_EMPLOYEE. As soon as an operation
impacts any of the two bodies, the two relations do not equate
anymore.
As a consequence, if I then run
[MAKE VIP_MEMBER = VIP_MEMBER - {1, 1} ] --> delete
[MAKE RICH_EMPLOYEE = RICH_EMPLOYEE - {1, 2} ]
VIP_MEMBER and RICH_EMPLOYEE relation are not equal anymore because
only their header and constraint set are equal.
> By the way, I should have prefaced my first response to the thread
> with the disclaimer that I'm by no means a language designer, so you
> can feel free to take my comments with a grain of salt.
I am trying to gain a feedback and perception from all users that can
help me sharpen the language. You help is appreciated.
> TroyK
Cimode - 12 Mar 2008 20:08 GMT
> > > > Why not:
> > > > [MAKE RICH_EMPLOYEE = {EMPLOYEE WITH SALARY > 100000}]
[quoted text clipped - 29 lines]
>
> TroyK
Another way to put it would be to say that the system and subsequent
language *de facto* treats an un-ary relation as a type and that the
syntaxic use of [] or {} allows to make the difference.
> > > Why not:
> > > [MAKE RICH_EMPLOYEE = {EMPLOYEE WITH SALARY > 100000}]
[quoted text clipped - 12 lines]
> [MAKE R2 = R0 UNION R1]
> PRESENT2D [R2]
Few comments for you. Looks sound enough, but do you even need the
word "MAKE" (and why the capitals?). I also fear that the square
brackets around statements will make code look more confusing than
need be - are they really necessary (I understand they inidicate a
"relation expression").
You also mentioned that for constraints you use |constraint| - I'd
personally avoid that, given the use of the bar symbol in logical
disjunction. Whats wrong with good old parentheses used when
necessary?
> does the same thing as
>
> PRESENT2D [{ATTRIBUTE0_1, ATTRIBUTE0_2} UNION {ATTRIBUTE1_1,
> ATTRIBUTE1_2}]
As with TroyK, I found "present2d" to be a bit offputting. In your
initial examples I'd recommend just calling it "present"? Capitals
also give me flashbacks of Cobol PIC's, so I'd personally go lowercase
too ;)
Just my 2p worth.
> It is also about the coherence of the computing model behind. The
> input of the media layer is necessarily a relation. The input of the
> logical layer may either be a relation or an attribute set.
Cimode - 13 Mar 2008 21:06 GMT
[Snipped]
> Few comments for you. Looks sound enough, but do you even need the
> word "MAKE"
It is an arbitrary choice. In initial version, I thought about using
nothing then I thought about using SET and I finally settled on MAKE.
The idea is to create awareness that we are working with a construct
with potential users.
(and why the capitals?).
The MAKE verb is in fact case insensitive. I posted it this way only
to make it more readable in this thread.
> I also fear that the square
> brackets around statements will make code look more confusing than
> need be - are they really necessary (I understand they inidicate a
> "relation expression").
Well, it's a tough choice but this is what make the expressive power
of the language. When using brackets, one should think relation.
When one uses {} then we are shifting to attribute based thinking.
That back and forth shifting is what makes easier to shift from
relation level operation to tuple/attribute level operation. On a
broader context, I had to establish some kind of coherence in the
convention used to jump back and forth from regular thinking to set
oriented.
> You also mentioned that for constraints you use |constraint| - I'd
> personally avoid that, given the use of the bar symbol in logical
> disjunction. Whats wrong with good old parentheses used when
> necessary?
I like the idea. I may reconsider that. I thought about reserving
parenthesis to the media layer but that is an arbitrary choice.
> > does the same thing as
>
[quoted text clipped - 3 lines]
> As with TroyK, I found "present2d" to be a bit offputting. In your
> initial examples I'd recommend just calling it "present"
I can see that PRESENT2D seems confusing. My initial choice for
presenting the tabular format was simply TABLE but then I was afraid
to create an endless source of confusion for programmers priorly
exposed to SQL.
I was also thinking about possible non bidimensional presentations
such OLAP and the opportunity to create OLAP cubes such as
PRESENT3D(A1, A2, A5)[relation] which would be a cube with 3
dimensions.
PRESENT-N-D(A1.......AN)[relation]
Based on your comment I might simply make PRESENT2D a synonym for
PRESENT.
> ? Capitals
Just in this thread. The verbs used in the language are totally case
insensitive for the compiler.
> also give me flashbacks of Cobol PIC's, so I'd personally go lowercase
> too ;)
I will leave it open to programmers choice.
> Just my 2p worth.
Thank you very much. That was helpful/
Cimode - 15 Mar 2008 17:22 GMT
<<Capitals also give me flashbacks of Cobol PIC's,>>
I know the pain thrust me. Even worse, do you remember 88's? It was
a cheap trick to allow to redefine data structure at run time with no
strings attached.
Last time I coded COBOL, I think my last thought was something like
*They will have to pay me lots of money if they want me to do this all
over again*.