MACSCRPT Archives

February 2008

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Mark J. Reed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Sun, 17 Feb 2008 12:17:27 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (45 lines)
The need for HAVING vs WHERE is tied to somewhat obscure details of
the way SQL queries are processed.  But yeah, SQL was the first thing
I thought of.
   Still, most languages that have built-in lists have a way to
extract only the desired elements of a list.  Perl grep, Ruby
find_all, Lisp remove-if-not, Python filter, Tcl lsearch.
Applescript's syntax is more natural for some common cases, while
making others that don't fit the English clause structure as well seem
more awkward.


On 2/17/08, David Livesay <[log in to unmask]> wrote:
> On Feb 16, 2008, at 7:50 PM, Christopher Green wrote:
>
> > One of the things AS spoiled me with from early on is
> > "whose clauses" (apparently also known as the by-test
> > reference form). My question is, for those of you who
> > reeeeally know other scripting/programming languages,
> > what other languages have this funcionality as a basic
> > feature??
> >
> > Anyone?
>
> The "WHERE" clause in SQL is essentially the same thing.
>
> SELECT lastname FROM users WHERE firstname LIKE 'Chris%'
>
> This means roughly the same thing as...
>
> get the lastname of every user whose firstname begins with 'Chris'
>
> But the thing I love about SQL is that it omits articles and copulae.
> I call it a Tonto language, because most statements come out sounding
> like that character's speech in the Lone Ranger radio and TV series.
> Tarzan language would be equally applicable.
>
> SQL also has a "HAVING" clause for restricting grouped data.
>
> SELECT a, sum(b) FROM thistable GROUP BY a HAVING a < 100
>


-- 
Mark J. Reed <[log in to unmask]>

ATOM RSS1 RSS2