caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Oliver Bandel <oliver@first.in-berlin.de>
To: Markus Mottl <markus@oefai.at>
Cc: Oleg <oleg_inconnu@myrealbox.com>, caml-list@inria.fr
Subject: Re: [Caml-list] Calling a function with a self-defined type as argument
Date: Thu, 22 Aug 2002 22:40:53 +0200 (MET DST)	[thread overview]
Message-ID: <Pine.LNX.3.95.1020822223443.577A-100000@first.in-berlin.de> (raw)
In-Reply-To: <20020822131519.GA32496@bach.ai.univie.ac.at>

Hello Markus,

On Thu, 22 Aug 2002, Markus Mottl wrote:

> Oliver Bandel schrieb am Thursday, den 22. August 2002:
> > But the Line ("text")-argument is only complete as a Line(),
> > if Line() has a higher priority than the function-call.
> > I have *one* argument, which is complete if given EMPTY,
> > and complete if given Line ("argument").
> 
> The parser attempts to parse arguments of a function call, all of
> which must be expressions. "Line" is not an expression, it's just a
> data constructor. To disambiguate things, you have to use parentheses.
> Note that your proposal that the compiler should use type definitions
> to see how many arguments constructors take would make sources really
> unreadable for humans.  Things are perfect as they are.

OK, I believe it you.
I'm the beginner in Ocaml, not you. ;-)

I have to program more in Ocaml, then I will see
how it works.

After looking again on my sources (the one I mailed to the list)
I found some other things, I could do better, e.g. not use
Empty_Line for Line "", because it does not help much, but
yields some problems.

All in all I see, that I have some problems with Ocaml,
because I have not used it very often.

But even after this short time of using functional programming
(I looked a littlebid into it and then made a pause, looked
again in and made a pause) I'm very annoyed, when I use imperative
programming.
E.G. the reading of the lines and comparing them with my
ad-hoc parsing is really annoying, especially, when I
want to put the read text into an array of strings or
array of objects...

...when programming in the usual C-like style, I'm now
constantly annoyed.

I will try some more functional ideas and use recursion
instead of loops. I hope that helps.



[...]
> It may be clear here but not always. Even if things can be tractably
> analyzed by an intelligent compiler, you still need to enforce readability
> of sources. It would be absolute hell to let people parse such programs,
> because they'd constantly have to look up type definitions in other
> places to parse things correctly. Not a problem for a compiler - huge
> problem for humans!

OK.

I maybe one day will see the advantages. ;-)

Ciao,
   Oliver

-------------------
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:[~2002-08-22 20:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-22  1:11 Oliver Bandel
2002-08-22  1:43 ` SooHyoung Oh
2002-08-22  1:50 ` Oleg
2002-08-22  2:20   ` Pal-Kristian Engstad
2002-08-22  2:32     ` Dimitri Ara
2002-08-22 12:40   ` Oliver Bandel
2002-08-22 13:15     ` Markus Mottl
2002-08-22 20:40       ` Oliver Bandel [this message]
2002-08-22  2:04 ` Dimitri Ara
2002-08-22 12:47   ` Oliver Bandel
2002-08-22 13:13     ` Sven LUTHER
2002-08-22 14:07     ` Remi VANICAT
2002-08-22 14:15       ` Markus Mottl
2002-08-22 23:51   ` Pixel

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=Pine.LNX.3.95.1020822223443.577A-100000@first.in-berlin.de \
    --to=oliver@first.in-berlin.de \
    --cc=caml-list@inria.fr \
    --cc=markus@oefai.at \
    --cc=oleg_inconnu@myrealbox.com \
    /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).