Erlang Mailing Lists

Author Message

<  Erlang questions mailing list  ~  Guards and side effects

robert.virding at telia.c
Posted: Sun Mar 27, 2005 12:52 am Reply with quote
Guest
Sorry for missing this but I have not been on for a while.

I think that Joe said it all in another thread:

It's not an ugly wart - it's deliberate.

Guards are merely extensions of pattern matching - they must be side
effect free
and capably of efficient compilation.

Soon you hve the whole application in guards. Look at the Common Lisp
format function.

Robert


Thomas Johnsson XA (LN/EAB) wrote:

>(Subduing the hardcore functional programmer in me for a bit ... Smile
>
>I see really no compelling reason to prohibit side effects in guards,
>in fact there may well be sensible uses, for instance, communicating
>with another process to find out the value of the guard, consult ets tables
>or other data bases, call a memo function ....
>
>The only tricky place, as far as I can see, is guard evaluation
>in a receive: to evaluate guards to select a message in the own process in-queue,
>it makes sense *not* to allow another 'recursive' receive to find the value of the guard,
>but to issue a run time error instead.
>( An aside: this is akin to black hole:ing in implementing a lazy functional language, where in
>the process of evaluating a 'thunk' you need the value of the same thunk)
>
>There are many opportunities for the programmer to shoot him/herself in the foot,
>but to hold the programmer in strict harness in this particular corner of the
>language, and nowhere else, I find that misguided.
>
>-- Thomas
>
>
>


Post generated using Mail2Forum (http://m2f.sourceforge.net)
wuji
Posted: Tue Sep 18, 2012 7:37 am Reply with quote
User Joined: 10 Aug 2012 Posts: 654
long-dead king of rock 'n roll."You name it, I got got [h4]cheap jordan shoes[/h4] got it," he confessed to ABCNews.com.Cary's multiple televisions and DVDs
Elvis around the clock, and on weekends at city clubs clubs replica designer *beep* clubs and in national gigs, he becomes Elvis."When I'm dressed
like Elvis, I feel like Superman. I'm the king of of cheap jordans for sale of rock 'n roll -- TCB," says Cary, quoting Elvis
acronym for "taking care of business," a phrase the singer singer cheap jordans free shipping singer coined when his life, like Cary's, began its downward
am poor man, but my things make me feel rich."Cary's rich."Cary's [h2]cheap jordan shoes[/h2] rich."Cary's story kicks off the first episode in the fourth
of TLC's "Hoarding: Buried Alive," which airs Sunday, July 8 8 cheap designer *beep* 8 at 9 p.m. The series examines the lives of
whose emotional attachment to objects causes serious health and safety safety [h1]authentic jordans[/h1] safety dangers and threatens their relationships with family and friends."The
Cary doesn't exist anymore," says his friend Joe, who, with with cheap replica *beep* with wife Francesca on the TV show, unsuccessfully tries to
clear a pathway through the bags of food and debris debris cheap authentic jordans debris that eat up every inch of Cary's apartment."There is
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 2 of 2
Goto page Previous  1, 2
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum