Re: Pronouns in programming language?

torbenm@diku.dk (Torben AEgidius Mogensen)
3 Mar 2000 08:59:27 -0500

          From comp.compilers

Related articles
[3 earlier articles]
Re: Pronouns in programming language? pwagle@my-deja.com (2000-02-28)
Re: Pronouns in programming language? jjones@cs.uiuc.edu (2000-02-28)
Re: Pronouns in programming language? mal@bewoner.dma.be (Lieven Marchand) (2000-02-28)
Re: Pronouns in programming language? hamish.a@virgin.net (Hamish Atkinson) (2000-02-28)
Re: Pronouns in programming language? rkrayhawk@aol.com (2000-02-28)
Re: Pronouns in programming language? ele@freesurf.ch (H. Ellenberger) (2000-02-28)
Re: Pronouns in programming language? torbenm@diku.dk (2000-03-03)
Re: Pronouns in programming language? schairer@dai.ed.ac.uk (Axel Schairer) (2000-03-03)
Re: Pronouns in programming language? jejones@microware.com (James Jones) (2000-03-03)
Re: Pronouns in programming language? cbrtjr@ix.netcom.com (Charles E. Bortle, Jr.) (2000-03-06)
Re: Pronouns in programming language? cbrtjr@ix.netcom.com (Charles E. Bortle, Jr.) (2000-03-06)
Re: Pronouns in programming language? mal@bewoner.dma.be (Lieven Marchand) (2000-03-06)
Re: Pronouns in programming language? carles.blas@uab.es (Carles Blas Anglada) (2000-03-06)
[6 later articles]
| List of all articles for this month |
From: torbenm@diku.dk (Torben AEgidius Mogensen)
Newsgroups: comp.compilers
Date: 3 Mar 2000 08:59:27 -0500
Organization: Department of Computer Science, U of Copenhagen
References: 00-02-149
Keywords: design

John Fremlin <vii@altern.org> writes:


>Has any programming language/compiler implemented pronoun like
>constructs? For example:


> if variable_with_long_name == '2 ,
> { do this; }
> if it == '3 , # equivalent to: variable_with_long_name == '3
> { do that }




In the interactive system of Standard ML, "it" refers to the value of
the expression evaluated at the most recent prompt. SO, you can write
something like


- 2*(3+4);
> val it = 14 : int
- it*7;
> val it = 98 : int
-


where the "-" is the prompt and the result is shown after the ">".
Basically, an expression at the prompt is evaluated like the
declaration "val it = <expression>". Subsequent expressions creates
new instances of the name "it" and binds these to the new values.


Torben Mogensen (torbenm@diku.dk)


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.