Re: The IDS, the EDS and the DBMS
Date: Sun, 12 Sep 2004 16:22:19 GMT
Message-ID: <%I_0d.30754$MQ5.23684_at_attbi_s52>
"Fredrik Bertilsson" <fredrik_bertilsson_at_passagen.se> wrote in message news:31f7e57d.0409112110.330f9972_at_posting.google.com...
> > I don't think an API is up to the task. Collections are such an
> > important part of language that they should be directly included.
> >
> > I note that math textbooks have no problems with a unified
> > notation for functions and sets; I consider that a good starting
> > place.
>
> Can you give an (code) example of how such a solution would look like?
> I suppose that you are not talking about embedded SQL.
Very roughly:
// declare a relation S of (int,string)
S{i:int, s:string}
R{i:int, t:date}
// expression for all members of S such that i is between 1 and 10 // select s from S where i between 1 and 10 S{s | 1 <= i <= 10}
// natural join S and R where f(i) = 0 for all i in S // Here, I use "**" in place of the tie glyph // conventionally used for joins. // select S.i, S.s, R.t from S natural join R where f(S.i) = 0S{i, s | f(i) = 0} ** R
This is pretty much character-for-character how these expressions might appear in a math textbook. The notation is quite compact, but still readable. (I note that much of code readability rests on the choice of identifiers.) I also note it's probably not any harder to parse than SQL.
Realistically, you'd probably stick with == for equality-check, to disambiguate it from assignment.
Marshall Received on Sun Sep 12 2004 - 18:22:19 CEST