caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [oliver: Re: [Caml-list] Suggestion: Pervasives.identity]
@ 2004-04-23 20:10 Oliver Bandel
  0 siblings, 0 replies; only message in thread
From: Oliver Bandel @ 2004-04-23 20:10 UTC (permalink / raw)
  To: caml-list

----- Forwarded message from oliver -----

To: Martin Jambon <martin_jambon@emailuser.net>
Subject: Re: [Caml-list] Suggestion: Pervasives.identity

On Fri, Apr 23, 2004 at 08:18:21PM +0800, Martin Jambon wrote:
> Hello,
> 
> Is there a good why there is no predefined identity function?
> (fun x -> x) is sometimes less readable, and seems to be not
> compiled (yet?) as this black magic:
> external identity : 'a -> 'a : "%identity"
> 
> In the same style, we already have Pervasives.ignore, so why not
> Pervasives.identity?
> 

When/where/why do you need such a function?

And why don't you define it yourself?

let id x = x

THIS does not seem to compicated or unconvenient to do it
by yourself.

But why do you want to have such a function?

I see no reason to have such a function.

If you for example call a function and give it as one parameter
a <something> why should you instead give it an
id <something> ?!

and why not give back then id ( id <something> )
or
id ( id ( id <something> ) )????

What would that be good for?


Why not saying  x  instead of (fun x -> x) ?????

Do you like function calls so much, that you
are doing as much as you can in your code?


Ciao,
   Oliver

----- End forwarded message -----

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-04-23 20:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-23 20:10 [oliver: Re: [Caml-list] Suggestion: Pervasives.identity] Oliver Bandel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).