From: David Krmpotic
Subject: clean, non-clean functions
Date: 
Message-ID: <advi42$1u3$1@planja.arnes.si>
hi!


could somebody please tell me what is definition of clean and not-clean
functions? what is this exactly.


thanx

David

From: Kaz Kylheku
Subject: Re: clean, non-clean functions
Date: 
Message-ID: <slrnag77vh.3on.kaz@localhost.localdomain>
On Sun, 9 Jun 2002 14:45:02 +0100, David Krmpotic <····@email.REMOVEsi> wrote:
>hi!
>
>
>could somebody please tell me what is definition of clean and not-clean
>functions? what is this exactly.

Clean: ``Written the way I would have written it.''

Not clean: ``Written in any other way.''
From: Joe Marshall
Subject: Re: clean, non-clean functions
Date: 
Message-ID: <vUOM8.19572$fT5.5198743@typhoon.ne.ipsvc.net>
"Kaz Kylheku" <···@localhost.localdomain> wrote in message ·······················@localhost.localdomain...
> On Sun, 9 Jun 2002 14:45:02 +0100, David Krmpotic <····@email.REMOVEsi> wrote:
> >hi!
> >
> >
> >could somebody please tell me what is definition of clean and not-clean
> >functions? what is this exactly.
>
> Clean: ``Written the way I would have written it.''
>
> Not clean: ``Written in any other way.''

Here is a function

   (defun fac (n)
     (if (zerop n)
         1
         (* n (fac (1- n)))))


Here is the same function written in Clean

   fac :: Int -> Int
   fac 0 = 1
   fac n = n * fac (n-1)
From: sv0f
Subject: Re: clean, non-clean functions
Date: 
Message-ID: <none-0906021901350001@129.59.212.53>
In article <·······················@typhoon.ne.ipsvc.net>, "Joe Marshall"
<·············@attbi.com> wrote:

[snip]
>Here is a function
>
>   (defun fac (n)
>     (if (zerop n)
>         1
>         (* n (fac (1- n)))))
>
>
>Here is the same function written in Clean
>
>   fac :: Int -> Int
>   fac 0 = 1
>   fac n = n * fac (n-1)

And in Kleene?
From: Donald Fisk
Subject: Re: clean, non-clean functions
Date: 
Message-ID: <3D03A189.8FF65D3C@enterprise.net>
David Krmpotic wrote:
> 
> hi!
> 
> could somebody please tell me what is definition of clean and not-clean
> functions? what is this exactly.

Clean functions = functions written in clean (a functional programming
language), I guess.

Non-clean functions = functions written in anything other than clean.

Could you perhaps give us a clue about the context in which they were
referred to?

> David

-- 
Dalinian: Lisp. Java. Which one sounds sexier?
RevAaron: Definitely Lisp. Lisp conjures up images of hippy coders,
drugs,
sex, and rock & roll. Late nights at Berkeley, coding in Lisp fueled by
LSD.
Java evokes a vision of a stereotypical nerd, with no life or social
skills.
From: David Krmpotic
Subject: Re: clean, non-clean functions
Date: 
Message-ID: <ae1luh$fp5$1@planja.arnes.si>
Thanx for your responses. I think that what was ment here has nothing to do
with language Clean.
I believe that clean (or pure ?!) are really those without side effects. I
have found this in list of possible questions for exam 'principles of
programming languages'.

thanx again.

"Donald Fisk" <················@enterprise.net> wrote in message
······················@enterprise.net...
> David Krmpotic wrote:
> >
> > hi!
> >
> > could somebody please tell me what is definition of clean and not-clean
> > functions? what is this exactly.
>
> Clean functions = functions written in clean (a functional programming
> language), I guess.
>
> Non-clean functions = functions written in anything other than clean.
>
> Could you perhaps give us a clue about the context in which they were
> referred to?
>
> > David
>
> --
> Dalinian: Lisp. Java. Which one sounds sexier?
> RevAaron: Definitely Lisp. Lisp conjures up images of hippy coders,
> drugs,
> sex, and rock & roll. Late nights at Berkeley, coding in Lisp fueled by
> LSD.
> Java evokes a vision of a stereotypical nerd, with no life or social
> skills.
>
From: Duane Rettig
Subject: Re: clean, non-clean functions
Date: 
Message-ID: <4d6uz865i.fsf@beta.franz.com>
"David Krmpotic" <····@email.REMOVEsi> writes:

> Thanx for your responses. I think that what was ment here has nothing to do
> with language Clean.
> I believe that clean (or pure ?!) are really those without side effects. I
> have found this in list of possible questions for exam 'principles of
> programming languages'.

My own definition of "clean" varies with the context, and usually means
"bug-free", and less often "free from unnecessary code, elegant", or
sometimes "portable to other implementations".  CL has no actual definition
of the term "clean".

But I strongly suggest for the sake of your grade that you find out within
what context your _professor_ wants the term defined, because however right
any definition that we give could be, if it does not match your professor's
notion, it will be wrong.

If the question was on a possible list of exam questions, then the answer
will be in your course material, lecture notes (if complete), or some
derivative reference from these.  If you're checking out such possible
derivative references by asking this question here, then prune this branch;
the answer is not here.

-- 
Duane Rettig          Franz Inc.            http://www.franz.com/ (www)
1995 University Ave Suite 275  Berkeley, CA 94704
Phone: (510) 548-3600; FAX: (510) 548-8253   ·····@Franz.COM (internet)
From: David Krmpotic
Subject: Re: clean, non-clean functions
Date: 
Message-ID: <ae2p1j$api$1@planja.arnes.si>
"Duane Rettig" <·····@franz.com> wrote in message
··················@beta.franz.com...
> "David Krmpotic" <····@email.REMOVEsi> writes:
>
> > Thanx for your responses. I think that what was ment here has nothing to
do
> > with language Clean.
> > I believe that clean (or pure ?!) are really those without side effects.
I
> > have found this in list of possible questions for exam 'principles of
> > programming languages'.
>
> My own definition of "clean" varies with the context, and usually means
> "bug-free", and less often "free from unnecessary code, elegant", or
> sometimes "portable to other implementations".  CL has no actual
definition
> of the term "clean".
>
> But I strongly suggest for the sake of your grade that you find out within
> what context your _professor_ wants the term defined, because however
right
> any definition that we give could be, if it does not match your
professor's
> notion, it will be wrong.
>
> If the question was on a possible list of exam questions, then the answer
> will be in your course material, lecture notes (if complete), or some
> derivative reference from these.  If you're checking out such possible
> derivative references by asking this question here, then prune this
branch;
> the answer is not here.
>
> --
> Duane Rettig          Franz Inc.            http://www.franz.com/ (www)
> 1995 University Ave Suite 275  Berkeley, CA 94704
> Phone: (510) 548-3600; FAX: (510) 548-8253   ·····@Franz.COM (internet)

no it's ok, thank you. I'm sure that this is what he wants. and, no, it
isn't anywhere in lecture notes. because this is very strange professor we
have (I hope he's not reading this :)
From: James A. Crippen
Subject: Re: clean, non-clean functions
Date: 
Message-ID: <m3vg8qgo56.fsf@kappa.unlambda.com>
"David Krmpotic" <····@email.REMOVEsi> writes:

> no it's ok, thank you. I'm sure that this is what he wants. and, no, it
> isn't anywhere in lecture notes. because this is very strange professor we
> have (I hope he's not reading this :)

Most professors are strange.  Most are just strange in nonobvious
ways, otherwise they wouldn't get hired.  Occasionally the really,
obviously strange one slips through despite all odds to the contrary.
Then he (for the really strange ones are *always* male) usually gets
given a converted broom closet for an office and gets to teach only
first year classes with no TAs.  This is why so many people drop out
of higher education within the first year... ^_^

'james

-- 
James A. Crippen <·····@unlambda.com> ,-./-.  Anchorage, Alaska,
Lambda Unlimited: Recursion 'R' Us   |  |/  | USA, 61.20939N, -149.767W
Y = \f.(\x.f(xx)) (\x.f(xx))         |  |\  | Earth, Sol System,
Y(F) = F(Y(F))                        \_,-_/  Milky Way.
From: Paolo Amoroso
Subject: Re: clean, non-clean functions
Date: 
Message-ID: <aGAHPdaGUrqRJVYTLuNaKyNX9TtD@4ax.com>
On 11 Jun 2002 01:28:37 -0800, ·····@unlambda.com (James A. Crippen) wrote:

> Then he (for the really strange ones are *always* male) usually gets
> given a converted broom closet for an office and gets to teach only
> first year classes with no TAs.  This is why so many people drop out

Possibly with a poster showing a UFO and the sign "I want to be leave"
hanging from the office's wall.


Paolo
-- 
EncyCMUCLopedia * Extensive collection of CMU Common Lisp documentation
http://www.paoloamoroso.it/ency/README
From: Vladimir Zolotykh
Subject: Re: clean, non-clean functions
Date: 
Message-ID: <3D0393F3.2C866228@eurocom.od.ua>
I'd suggested a hypothesis that 'clean' means 'written in
functional style' e.g. without any side effects. What such
function does depends only on its arguments and has no results
or consequences but returned value(s).

David Krmpotic:
> 
> could somebody please tell me what is definition of clean and not-clean
> functions? what is this exactly.
From: Kent M Pitman
Subject: Re: clean, non-clean functions
Date: 
Message-ID: <sfwy9dnhz0q.fsf@shell01.TheWorld.com>
Vladimir Zolotykh <······@eurocom.od.ua> writes:

> David Krmpotic:
> > 
> > could somebody please tell me what is definition of clean and not-clean
> > functions? what is this exactly.
(1)
> I'd suggested a hypothesis that 'clean' means 'written in
> functional style' e.g. without any side effects. 
(2)
> What such
> function does depends only on its arguments and has no results
> or consequences but returned value(s).

[Numbering added.]

Your remark (1) is perhaps right here.  I usually call such functions
"pure functions".  Clean (and particularly "unclean") has a
connotation of righteousness (or lack thereof) that often is ill-placed.
But either way, there is additional complexity to be taken note of.

Your remark (2) does not necessarily follow from (1).  Consider:

 (lambda () x)

This might by some definitions be a pure function, but not by others.
It does not depend on its arguments.  It does depend on "other state not
contained within it".  But functions like this do commonly occur within
most computations that people consider pure.

In thinking about functions, it may be useful to think in database terms...

Some functions can be computed in a context-free way and require no
database locking.

Some functions need to read but not set the environment.  In a
database world, these functions would need read locks.  In a lispy
world, it mostly means that calls to these functions can't be moved by
the compiler across other functions which do writing (but can be
freely moved across calls to other functions that only read).

Some functions write the environment (often reading it first) and would
require write locks in database terms.  In CL, this mostly means calls to
such functions cannot be commuted with other function calls that do either
reading or writing--only with functions that are context-free.
From: Chris Riesbeck
Subject: Re: clean, non-clean functions
Date: 
Message-ID: <riesbeck-F65469.13032010062002@news.it.nwu.edu>
In article <···············@shell01.TheWorld.com>, Kent M Pitman 
<······@world.std.com> wrote:

>Vladimir Zolotykh <······@eurocom.od.ua> writes:
>
>(1)
>> I'd suggested a hypothesis that 'clean' means 'written in
>> functional style' e.g. without any side effects. 
>
>Your remark (1) is perhaps right here.  I usually call such functions
>"pure functions".  Clean (and particularly "unclean") has a
>connotation of righteousness (or lack thereof) that often is ill-placed.

No danger of that with "pure" vs "unpure" ...
From: Marcin Tustin
Subject: Re: clean, non-clean functions
Date: 
Message-ID: <yztbofdxykfx.fsf@werewolf.i-did-not-set--mail-host-address--so-shoot-me>
"David Krmpotic" <····@email.REMOVEsi> writes:

> hi!
> 
> 
> could somebody please tell me what is definition of clean and not-clean
> functions? what is this exactly.

    This sounds like "hygienic" and "non-hygienic", terms I've heard
in connection with Scheme macros (Not that I know what they mean).
Try heading to comp.lang.scheme, and asking there.

-- 
You're trapped in my mental fog box! I'm gonna tear you up with this shit!!!