caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: oliver@first.in-berlin.de (Oliver Bandel)
To: caml-list@inria.fr
Subject: [oliver: Re: [Caml-list] Suggestion: Pervasives.identity]
Date: Fri, 23 Apr 2004 22:10:24 +0200	[thread overview]
Message-ID: <20040423201023.GG271@first.in-berlin.de> (raw)

----- 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


                 reply	other threads:[~2004-04-23 20:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040423201023.GG271@first.in-berlin.de \
    --to=oliver@first.in-berlin.de \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).