malc | 1 Nov 04:28 2001

Anounce: Second shared patch.


You can find it at http://algol.prosalg.no/~malc/scaml notable additions:
* Patch is now against OCaml 3.03 Alpha
* Implemented Natdynlink library, while its not drop in replacement for
  Dynlink, its reasonably easy to convert
* Which is illustrated by Camlp4 patch(included)

--

-- 
mailto:malc <at> pulsesoft.com

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request <at> inria.fr  Archives: http://caml.inria.fr

Jacques Garrigue | 1 Nov 06:45 2001
Picon
Picon

Re: Optional arguments and type annotations

From: Christian RINDERKNECHT <rinderkn <at> hugo.int-evry.fr>

> I am used to annotate the top-level functions with their types, and I
> was surprised to see that I must write the following to make it
> type-check: 
> 
> #let bump ?(step:int option) (x:int) =
>    match step with
>      None -> x * 2
>    | Some y -> x + y
>  ;;
> val bump : ?step:int -> int -> int = <fun>
> 
> and then there is a discrepancy between the "int option" annotation in
> the .ml and the "int" in the interface.

As you can see with the pattern matching, from inside the function
step is of type "int option". But since it is optional, when applying
the function you can simply pass an argument of type "int", which is
reflected by the external type of the function.

This is not to say that there is no discrepancy: actually, if you pass
an argument with label ?step: instead of ~step:, it has to be of type
"int option", so that we could have written "?step:int option -> int
-> int". But since an optional argument must always have type "t
option", the "option" part is redondant, and omitted in the
printed and parsed types (it actually appears inside the type checker).

Hope this is not too misleading.

(Continue reading)

Daniel de Rauglaudre | 1 Nov 11:01 2001
Picon
Picon

Re: raise extra arg ignored

Hi,

On Wed, Oct 31, 2001 at 08:09:37PM +0100, Remi VANICAT wrote:

> Even if we change the priority of the application of raise ?

It works indeed. I was sure that it would not but I tested and there
is indeed a syntax error at "raise Foo 3".

It works, not because of priorities, but because the application is
defined as a list of simple expressions. If the construction "raise"
is defined as expression (not "simple"), it cannot be used in an
application.

   ---

I am a little bit surprised, because yacc sometimes bypass priorities
to avoid syntax errors: for example "comma" as more priority than "as":
        x, y as z
means
        (x, y) as z
but:
        function x, y as z, t -> x
is however accepted, althought it should be a syntax error at the
comma after "z".

This makes me wonder about camlp4, because to resolve this problem of
"comma" and "as", I added a rule to "try again" the continuation of a
grammar entry when a syntax error about priorities happens. And
because of that, I cannot prevent "raise Foo 3" to be accepted in
(Continue reading)

Marcin 'Qrczak' Kowalczyk | 1 Nov 12:21 2001
Picon

Big_int

Why do these functions perform copies of the abs_value instead of
sharing it? I thought that big_ints are immutable.

(* Opposite of a big_int *)
let minus_big_int bi =
 { sign = - bi.sign;
   abs_value = copy_nat (bi.abs_value) 0 (num_digits_big_int bi)}

(* Absolute value of a big_int *)
let abs_big_int bi =
    { sign = if bi.sign = 0 then 0 else 1;
      abs_value = copy_nat (bi.abs_value) 0 (num_digits_big_int bi)}

--

-- 
 __("<  Marcin Kowalczyk * qrczak <at> knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^
QRCZAK

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request <at> inria.fr  Archives: http://caml.inria.fr

Krishnaswami, Neel | 1 Nov 16:31 2001

Type declaration question

Hello,

I'm wondering why record declarations can't be part of a regular
variant type declaration. Eg, is there a special reason that this
is illegal:

type expr = 
  | Fun of {formal: string; body: expr}
  | App of {func: expr; arg: expr}

and I must write: 

type expr = 
  | Fun of fun_expr
  | App of app_expr
and fun_expr = {formal: string; body: expr}
and app_expr = {func: expr; arg: expr}

IIRC the first version is ok in SML. Why the difference in Caml?

--
Neel Krishnaswami
neelk <at> cswcasa.com
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request <at> inria.fr  Archives: http://caml.inria.fr

Oliver Bandel | 1 Nov 17:29 2001
Picon

OCaml-book planned...

Hello,

as they told me, the french O'Reilley-publisher
has planned to put the english-translation of
the french OCaml-book free to the public-webspace.
It's planned to publish the webpages in February 2002.

And they think about publishing it as a book after that.

Ciao,
   Oliver

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request <at> inria.fr  Archives: http://caml.inria.fr

Oliver Bandel | 2 Nov 02:13 2001
Picon

Re: OCaml-book planned...

Hi!

On Thu, 1 Nov 2001, Markus Mottl wrote:

> Oliver Bandel schrieb am Donnerstag, den 01. November 2001:
> > as they told me, the french O'Reilley-publisher has planned to
> > put the english-translation of the french OCaml-book free to the
> > public-webspace.  It's planned to publish the webpages in February 2002.
> 
> Wow, that nearly sounds too good to be true!  It's a bit surprising
> that the people on the translators' list haven't yet been told about
> O'Reilly's future plans though these obviously exist.

Well, I asked the people from the german O'Reilley and
said a lot of nice words about the O'Reilley company. :-)
And so a woman from the german O'reilley gave me the mailaddress
of the right person to talk about it. :-)

> 
> > And they think about publishing it as a book after that.
> 
> Even better! Could you please give us more details about what they
> exactly wrote (e.g. forward us their e-mail)? I am sure I am not the
> only one here who is curious...

I have not much more informations.
But they told in their last answer that there is a
webpage in frenche, where we should look at.

I mail you this at the end of the weekend (sunday or so),
(Continue reading)

Oliver Bandel | 2 Nov 02:24 2001
Picon

Re: OCaml-book planned...


On Thu, 1 Nov 2001, Markus Mottl wrote:

> Oliver Bandel schrieb am Donnerstag, den 01. November 2001:
> > as they told me, the french O'Reilley-publisher has planned to
> > put the english-translation of the french OCaml-book free to the
> > public-webspace.  It's planned to publish the webpages in February 2002.
> 
> Wow, that nearly sounds too good to be true!  It's a bit surprising
> that the people on the translators' list haven't yet been told about
> O'Reilly's future plans though these obviously exist.

I gave the O#Reilly-publisher a hint to the ocaml-homepage and
the mailing-list.

Maybe he is interested in reading and writing here... :-)

Ciao,
   Oliver

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request <at> inria.fr  Archives: http://caml.inria.fr

Markus Mottl | 1 Nov 18:00 2001
Picon

Re: OCaml-book planned...

Oliver Bandel schrieb am Donnerstag, den 01. November 2001:
> as they told me, the french O'Reilley-publisher has planned to
> put the english-translation of the french OCaml-book free to the
> public-webspace.  It's planned to publish the webpages in February 2002.

Wow, that nearly sounds too good to be true!  It's a bit surprising
that the people on the translators' list haven't yet been told about
O'Reilly's future plans though these obviously exist.

> And they think about publishing it as a book after that.

Even better! Could you please give us more details about what they
exactly wrote (e.g. forward us their e-mail)? I am sure I am not the
only one here who is curious...

Regards,
Markus Mottl

--

-- 
Markus Mottl                                             markus <at> oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request <at> inria.fr  Archives: http://caml.inria.fr

Jean-Christophe Filliatre | 2 Nov 11:32 2001
Picon

[Caml-announce] exact real arithmetic


This is to announce an  exact real arithmetic module for ocaml, called
Creal (for Constructive Reals). It is available from here:

      http://www.lri.fr/~filliatr/software.en.html

This module provides  an abstract data type of  real numbers, on which
all operations are exact,  and return immediately. When necessary, one
can ask for an approximation of a real number to a given precision and
this triggers all the actual computations, including approximations of
some operands to higher precisions if necessary.

This implementation  is based  on Valérie Ménissier-Morain  PhD thesis
(http://www-calfor.lip6.fr/~vmm/arith_english.html)

The tarball  includes an ocaml  interface to GMP (GNU  Multi Precision
library), mainly written by David Monniaux.

Comments and suggestions are welcome.
--

-- 
Jean-Christophe Filliatre (http://www.lri.fr/~filliatr)


Gmane