Trivia question

classic Classic list List threaded Threaded
26 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Trivia question

Dirk Laurie-2
Name two computer languages in which `end` but not `begin` has syntactic
significance.

Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Rob Kendrick-2
On Wed, Apr 30, 2014 at 03:30:10PM +0200, Dirk Laurie wrote:
> Name two computer languages in which `end` but not `begin` has syntactic
> significance.

Lua, Basic.

B.

Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Volodymyr Bezobiuk
In reply to this post by Dirk Laurie-2
Lua, SQL ? :)



On Wed, Apr 30, 2014 at 4:30 PM, Dirk Laurie <[hidden email]> wrote:
Name two computer languages in which `end` but not `begin` has syntactic
significance.


Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Pierre Chapuis
In reply to this post by Rob Kendrick-2
> On Wed, Apr 30, 2014 at 03:30:10PM +0200, Dirk Laurie wrote:
>> Name two computer languages in which `end` but not `begin` has syntactic
>> significance.
>
> Lua, Basic.

Also, I think, Fortran. Which is probably what inspired Lua here?

--
Pierre Chapuis


Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Volodymyr Bezobiuk
In reply to this post by Rob Kendrick-2
Heh yeah, but Basic's END has no __syntactic__ significance, by the way. Am i wrong?


On Wed, Apr 30, 2014 at 4:34 PM, Rob Kendrick <[hidden email]> wrote:
On Wed, Apr 30, 2014 at 03:30:10PM +0200, Dirk Laurie wrote:
> Name two computer languages in which `end` but not `begin` has syntactic
> significance.

Lua, Basic.

B.


Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Pierre Chapuis
In reply to this post by Volodymyr Bezobiuk
> Lua, SQL ? :)

Doesn't BEGIN exist in SQL?

--
Pierre Chapuis


Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Volodymyr Bezobiuk
mmm, it is for starting the transaction, but at other end it is commit or rollback. at the other hand, END in SQL has syntactic meaning (CASE WHEN .. ELSE ... END)
It seems the second one is not SQL anyway, just wondering ))


On Wed, Apr 30, 2014 at 4:58 PM, Pierre Chapuis <[hidden email]> wrote:
> Lua, SQL ? :)

Doesn't BEGIN exist in SQL?

--
Pierre Chapuis



Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Rob Kendrick-2
In reply to this post by Volodymyr Bezobiuk
On Wed, Apr 30, 2014 at 04:56:54PM +0300, Volodymyr Bezobiuk wrote:
> Heh yeah, but Basic's END has no __syntactic__ significance, by the way. Am
> i wrong?

IF foo% = 1 THEN
  ...
END IF

Without the END, how would it know you weren't having a nested IF
clause?

B.

Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Roberto Ierusalimschy
In reply to this post by Pierre Chapuis
> > On Wed, Apr 30, 2014 at 03:30:10PM +0200, Dirk Laurie wrote:
> >> Name two computer languages in which `end` but not `begin` has syntactic
> >> significance.
> >
> > Lua, Basic.
>
> Also, I think, Fortran. Which is probably what inspired Lua here?

Lua got this from Modula 2. Modula 2 does have BEGIN, but it does
not use it for control structures:

   WHILE Index < 5 DO
      Index := Index + 1;
      WriteInt(Index,5);
   END;

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Bertrand Mansion
In reply to this post by Dirk Laurie-2

Le 30 avr. 2014 à 15:30, Dirk Laurie <[hidden email]> a écrit :

> Name two computer languages in which `end` but not `begin` has syntactic
> significance.
>

Lua, Eiffel ?



Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Volodymyr Bezobiuk
In reply to this post by Rob Kendrick-2
OK.

I know only very old MSX BASIC (from 80's) where you have obligatory line numbering and your IF will end at current line (not possible to write multiline IF constructs either). The END was only for ending program (like os.exit()). That's why


On Wed, Apr 30, 2014 at 5:10 PM, Rob Kendrick <[hidden email]> wrote:
On Wed, Apr 30, 2014 at 04:56:54PM +0300, Volodymyr Bezobiuk wrote:
> Heh yeah, but Basic's END has no __syntactic__ significance, by the way. Am
> i wrong?

IF foo% = 1 THEN
  ...
END IF

Without the END, how would it know you weren't having a nested IF
clause?

B.


Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Chris Berardi-2
In reply to this post by Dirk Laurie-2

On Apr 30, 2014 9:30 AM, "Dirk Laurie" <[hidden email]> wrote:
>
> Name two computer languages in which `end` but not `begin` has syntactic
> significance.
>

Lua, C Shell

Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Daurnimator
In reply to this post by Dirk Laurie-2
On 30 April 2014 09:30, Dirk Laurie <[hidden email]> wrote:
Name two computer languages in which `end` but not `begin` has syntactic
significance.

Lua, MATLAB
Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Peterson, Fox
darnit! I was about to say MATLAB!

“R” also? I think… no “begin.” 

Also, if this counts, ArcPy / (Python / highly supportive of SQL hybrid command line for ArcGIS, I’ve never used a “begin”)— maybe Python in general? (I never really use Python outside of Arc, so no idea).

Fox 

On Apr 30, 2014, at 9:18 AM, Daurnimator <[hidden email]> wrote:

On 30 April 2014 09:30, Dirk Laurie <[hidden email]> wrote:
Name two computer languages in which `end` but not `begin` has syntactic
significance.

Lua, MATLAB

Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Elias Barrionovo
On Wed, Apr 30, 2014 at 1:22 PM, Peterson, Fox
<[hidden email]> wrote:
> maybe Python in
> general? (I never really use Python outside of Arc, so no idea).


Regular Python does not have "end" as a keyword, since scope is
defined by indentation.


--
NI!

() - www.asciiribbon.org
/\ - ascii ribbon campaign against html e-mail and proprietary attachments

Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Daurnimator
In reply to this post by Daurnimator
MATLAB is also one of the few languages that use ~= for inequality.



On 30 April 2014 12:18, Daurnimator <[hidden email]> wrote:
On 30 April 2014 09:30, Dirk Laurie <[hidden email]> wrote:
Name two computer languages in which `end` but not `begin` has syntactic
significance.

Lua, MATLAB

Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Petite Abeille
In reply to this post by Pierre Chapuis

On Apr 30, 2014, at 3:58 PM, Pierre Chapuis <[hidden email]> wrote:

> Doesn't BEGIN exist in SQL?

Depends by what you mean by ‘SQL’… if referring to something like the formal ANSI syntax, e.g. SQL-92 & co, both ‘begin’ and ‘end’ are defined:

http://savage.net.au/SQL/sql-92.bnf.html#xref-BEGIN
http://savage.net.au/SQL/sql-92.bnf.html#xref-END

But in common use DML, one will seldom encounter ‘begin’, if ever. On the other hand, ‘end’ is rather common , e.g. 'case when … end’…

On the other hand, if you extend your definition of ‘SQL’ to procedural constructs such as PL/SQL, then of course your ‘SQL’ code will be littered  with ‘begin … end’ all over the place.
Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Dirk Laurie-2
In reply to this post by Daurnimator
2014-04-30 18:18 GMT+02:00 Daurnimator <[hidden email]>:
> On 30 April 2014 09:30, Dirk Laurie <[hidden email]> wrote:
>>
>> Name two computer languages in which `end` but not `begin` has syntactic
>> significance.
>>
> Lua, MATLAB

Those are the two I had in mind (in fact, IMHO Matlab overworks `end`,
missing the opportunity to use negative indices), but the other responses
have been an education for me.

Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Jay Carlson
In reply to this post by Chris Berardi-2

On Apr 30, 2014 11:54 AM, "Christopher Berardi" <[hidden email]> wrote:
>
> On Apr 30, 2014 9:30 AM, "Dirk Laurie" <[hidden email]> wrote:
> >
> > Name two computer languages in which `end` but not `begin` has syntactic
> > significance.
> >
>
> Lua, C Shell

"csh is not a language, it is a disease."

Reply | Threaded
Open this post in threaded view
|

Re: Trivia question

Dirk Laurie-2
2014-04-30 21:28 GMT+02:00 Jay Carlson <[hidden email]>:

> "csh is not a language, it is a disease."

Say quickly ten times: "She sells C-shells on the seashore."

12