caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* About the O'Reilly book on the web
@ 2006-11-25 18:38 Francois Colonna
  2006-11-27  9:07 ` [Caml-list] " Sebastien Ferre
  0 siblings, 1 reply; 19+ messages in thread
From: Francois Colonna @ 2006-11-25 18:38 UTC (permalink / raw)
  To: caml-list

Hello

in the version of the O'Reilly book on the web
http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora105.html#toc134

Chapter 11 about Str Library page 293

the followin example of a regular expression is given :

*let*| |english_date_format| ||=|| |Str.regexp| ||"[0-9]+\.[0-9]+\.[0-9]+"|| |;;


1 - if you are aware of how to compile a Library and try to compile 
this line you will get a Warning :

Warning X: illegal backslash escape in string.

Is that a typing error ? Who is in charge of this kind of corrections ?



2 - if you are not aware of how to compile a Library it will be impossible 
to make this line of code be compiled and linked.

It will be nice to warn the reader about this trouble (for example with a special icon) 
and to give him the possibility to find (quickly) a description of the rather 
difficult compilation procedure to be used in this case

Thanks

François Colonna


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-25 18:38 About the O'Reilly book on the web Francois Colonna
@ 2006-11-27  9:07 ` Sebastien Ferre
  2006-11-28 21:01   ` Philippe Wang
  0 siblings, 1 reply; 19+ messages in thread
From: Sebastien Ferre @ 2006-11-27  9:07 UTC (permalink / raw)
  To: caml-list; +Cc: colonna

Hello,

Francois Colonna wrote:
> Hello
> 
> in the version of the O'Reilly book on the web
> http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora105.html#toc134
> 
> Chapter 11 about Str Library page 293
> 
> the followin example of a regular expression is given :
> 
> *let*| |english_date_format| ||=|| |Str.regexp| 
> ||"[0-9]+\.[0-9]+\.[0-9]+"|| |;;

There should be a double backslash \\.
Indeed \ is a meta-chararcter of regular expressions, but also
of usual strings.
In general, all backslashes in regular expressions must be
doubled when represented as caml strings. For instance, the
same happens with groupings :

the regular expression : \([0-9]+\),\1

is represented by

let re = Str.regexp "\\([0-9]+\\),\\1"

Hope it helps,
Sebastien


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-27  9:07 ` [Caml-list] " Sebastien Ferre
@ 2006-11-28 21:01   ` Philippe Wang
  2006-11-28 22:33     ` Till Varoquaux
  0 siblings, 1 reply; 19+ messages in thread
From: Philippe Wang @ 2006-11-28 21:01 UTC (permalink / raw)
  To: caml-list

Hello,

If you look closer, you can see that the book is about the version 2.04.

http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora009.html

With OCaml 2.04, you don't have those warnings because they hadn't 
appeared yet.

         Objective Caml version 2.04

# "[0-9]+\.[0-9]+\.[0-9]+";;
- : string = "[0-9]+\\.[0-9]+\\.[0-9]+"

You can probably avoid warnings by backslashing your backslashes...

Still I believe the OCaml Team should find another way to express 
regular expressions, because if \. and \\. both mean \\. then it is a 
very bad idea...

Well, enjoy OCaml :-)

-- 
Philippe Wang
   mail@philippewang.info


PS : I hardly understand what I'm supposed to do to post in this 
mailing-list, so you have probably not received this one before, but 
maybe you already have...
(I hope this time it'll work...)


Sebastien Ferre a écrit :
> Hello,
> 
> Francois Colonna wrote:
>> Hello
>>
>> in the version of the O'Reilly book on the web
>> http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora105.html#toc134
>>
>> Chapter 11 about Str Library page 293
>>
>> the followin example of a regular expression is given :
>>
>> *let*| |english_date_format| ||=|| |Str.regexp| 
>> ||"[0-9]+\.[0-9]+\.[0-9]+"|| |;;
> 
> There should be a double backslash \\.
> Indeed \ is a meta-chararcter of regular expressions, but also
> of usual strings.
> In general, all backslashes in regular expressions must be
> doubled when represented as caml strings. For instance, the
> same happens with groupings :
> 
> the regular expression : \([0-9]+\),\1
> 
> is represented by
> 
> let re = Str.regexp "\\([0-9]+\\),\\1"
> 
> Hope it helps,
> Sebastien
> 
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-28 21:01   ` Philippe Wang
@ 2006-11-28 22:33     ` Till Varoquaux
  2006-11-28 22:47       ` Martin Jambon
  2006-11-28 23:07       ` Philippe Wang
  0 siblings, 2 replies; 19+ messages in thread
From: Till Varoquaux @ 2006-11-28 22:33 UTC (permalink / raw)
  To: Philippe Wang; +Cc: caml-list

hello!
On 11/28/06, Philippe Wang <lists@philippewang.info> wrote:
> Hello,
...
> # "[0-9]+\.[0-9]+\.[0-9]+";;
> - : string = "[0-9]+\\.[0-9]+\\.[0-9]+"
>
> You can probably avoid warnings by backslashing your backslashes...
>
> Still I believe the OCaml Team should find another way to express
> regular expressions, because if \. and \\. both mean \\. then it is a
> very bad idea...
Although I do agree the problem seems a little more complicated:
we are used to a more or less standard regexp syntax where special
chars can be escaped by \, this obviously clashes with escaping
characters in string if we pass strings to the function defining the
regular exceptions....
I would recommend treating all warnings as errors:
-warn-error A
to avoid such conflicts.

As far as I'm concerned I find the problem to be more complicated:
regular expressions are not syntaxily checked nor are they typed
checked when specified through strings. Some languages intergrate them
as first class values  thus allowing these verifications. Another
solution would be to build them using an Ocaml recursive sum type.
Although this would solve the syntax problem it would make regexp very
tedious to write. A library offering both options can be found at:
http://www.lri.fr/~marche/regexp/

Ideally one would want to precompile regular expression from strings
to actual constructed types using a preprocessor (e.g. camlp4). It
seems Francois Potier was one of the first to try such an approach:
[http://caml.inria.fr/pub/ml-archives/caml-list/2001/07/30b327c7c4b0fa5ace86dbf258e2c5d1.en.html]
I'm pretty sure this has been done in other libraries (regexp-pp  for
instance). Actual type-checking might prove a little harder to get
working.
Cheers,
Till
P.S.:Je confirme: j'ai bien recu ton mail ;-)...


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-28 22:33     ` Till Varoquaux
@ 2006-11-28 22:47       ` Martin Jambon
  2006-11-29  0:18         ` Philippe Wang
  2006-11-28 23:07       ` Philippe Wang
  1 sibling, 1 reply; 19+ messages in thread
From: Martin Jambon @ 2006-11-28 22:47 UTC (permalink / raw)
  To: Till Varoquaux; +Cc: Philippe Wang, caml-list

On Tue, 28 Nov 2006, Till Varoquaux wrote:

> hello!
> On 11/28/06, Philippe Wang <lists@philippewang.info> wrote:
> > Hello,
> ...
> > # "[0-9]+\.[0-9]+\.[0-9]+";;
> > - : string = "[0-9]+\\.[0-9]+\\.[0-9]+"
> >
> > You can probably avoid warnings by backslashing your backslashes...
> >
> > Still I believe the OCaml Team should find another way to express
> > regular expressions, because if \. and \\. both mean \\. then it is a
> > very bad idea...
> Although I do agree the problem seems a little more complicated:
> we are used to a more or less standard regexp syntax where special
> chars can be escaped by \, this obviously clashes with escaping
> characters in string if we pass strings to the function defining the
> regular exceptions....
> I would recommend treating all warnings as errors:
> -warn-error A
> to avoid such conflicts.
>
> As far as I'm concerned I find the problem to be more complicated:
> regular expressions are not syntaxily checked nor are they typed
> checked when specified through strings. Some languages intergrate them
> as first class values  thus allowing these verifications. Another
> solution would be to build them using an Ocaml recursive sum type.
> Although this would solve the syntax problem it would make regexp very
> tedious to write. A library offering both options can be found at:
> http://www.lri.fr/~marche/regexp/
>
> Ideally one would want to precompile regular expression from strings
> to actual constructed types using a preprocessor (e.g. camlp4). It
> seems Francois Potier was one of the first to try such an approach:
> [http://caml.inria.fr/pub/ml-archives/caml-list/2001/07/30b327c7c4b0fa5ace86dbf258e2c5d1.en.html]
> I'm pretty sure this has been done in other libraries (regexp-pp  for
> instance). Actual type-checking might prove a little harder to get
> working.

You should definitely have a look at micmatch. It's backslash free!

main page:  http://martin.jambon.free.fr/micmatch.html
tutorial:   http://martin.jambon.free.fr/micmatch-howto.html
reference:  http://martin.jambon.free.fr/micmatch-manual.html


Martin

--
Martin Jambon, PhD
http://martin.jambon.free.fr


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-28 22:33     ` Till Varoquaux
  2006-11-28 22:47       ` Martin Jambon
@ 2006-11-28 23:07       ` Philippe Wang
  1 sibling, 0 replies; 19+ messages in thread
From: Philippe Wang @ 2006-11-28 23:07 UTC (permalink / raw)
  To: Till Varoquaux; +Cc: caml-list

Hello,

> Although I do agree the problem seems a little more complicated:
> we are used to a more or less standard regexp syntax where special
> chars can be escaped by \, this obviously clashes with escaping
> characters in string if we pass strings to the function defining the
> regular exceptions....
> I would recommend treating all warnings as errors:
> -warn-error A
> to avoid such conflicts.

I am not used to using regexp with Caml... (although I write some 
scripts with OCaml instead of using Bash or Perl, or even Php, sometimes...)
But writing systematically the double backslash for a single regexp 
backslash and a quadruple backslash for a backslashed backslash... Well 
I wouldn't do it!


> As far as I'm concerned I find the problem to be more complicated:
> regular expressions are not syntaxily checked nor are they typed
> checked when specified through strings. Some languages intergrate them
> as first class values  thus allowing these verifications.

Last semester, with some friends we wrote a Caml compiler (that keeps 
the type informations at runtime), and one idea (which we did not 
implement because of some lack of time) was first class regexp, a bit 
like in Perl, while mixing it with the match-with-like syntax... (If 
only we could have as much time as we want or need...)

It could be something "usable", like :

matchr (* the matchr keyword is an example *)
   "some string"
with
| "PLOP 42 - \([0-9]\)" -> Int (int_of_string $1)
| "PLOP 43 - \(.*\)" -> $1

Then you can close it like in Coq with an "end" keyword, or just keep 
the OCaml syntaxe... (implicit closing, whatever)

Well, of course, bad thing could be that $ is a character for infix 
operators (but whatever it's not so important)

Then the question is still "What do we want OCaml to be?"
Do we want to make regexps easy to use with OCaml ? And are we ready to 
make OCaml bigger ("just") for that ?

> Another
> solution would be to build them using an Ocaml recursive sum type.
> Although this would solve the syntax problem it would make regexp very
> tedious to write. A library offering both options can be found at:
> http://www.lri.fr/~marche/regexp/

It looks really ... "not funny" I would say!


> Ideally one would want to precompile regular expression from strings
> to actual constructed types using a preprocessor (e.g. camlp4). It
> seems Francois Potier was one of the first to try such an approach:
> [http://caml.inria.fr/pub/ml-archives/caml-list/2001/07/30b327c7c4b0fa5ace86dbf258e2c5d1.en.html] 
> 
> I'm pretty sure this has been done in other libraries (regexp-pp  for
> instance). Actual type-checking might prove a little harder to get
> working.

Actually I don't really see the types problems...
If everything in return with $n has type string, then there is no 
matter... We can also easily detect that $4 does not exist for a regexp 
such as "\(PLOP[4-2]\) 42.*" :-p
(or decide that $4 would be an empty string, but it would seem a bit dirty)

Anyways, it would probably be more "a good thing" than "a bad thing"...

Philippe

> P.S.:Je confirme: j'ai bien recu ton mail ;-)...

PS : Je n'ai toujours pas compris comment ça marche...
  Parce que le mail qui est passé est celui qui a été envoyé avec la 
mauvaise adresse o_O
  Peut-être que je comprendrai un jour prochain...
(donc je retente avec la "mauvaise adresse" puisque ça semble mieux 
fonctionner)


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-28 22:47       ` Martin Jambon
@ 2006-11-29  0:18         ` Philippe Wang
  2006-11-29  1:48           ` Martin Jambon
  2006-11-29 17:25           ` brogoff
  0 siblings, 2 replies; 19+ messages in thread
From: Philippe Wang @ 2006-11-29  0:18 UTC (permalink / raw)
  To: Martin Jambon; +Cc: caml-list



Martin Jambon a écrit :

> You should definitely have a look at micmatch. It's backslash free!
> 
> main page:  http://martin.jambon.free.fr/micmatch.html
> tutorial:   http://martin.jambon.free.fr/micmatch-howto.html
> reference:  http://martin.jambon.free.fr/micmatch-manual.html

But isn't that making things "different again"?


I know so many people that do not want to use OCaml just because its 
syntax is (very) "different"...

(don't tell me about the alternative syntax, which is - to me - an 
"horror"...)

--
Philippe Wang
   mail@philippewang.info


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-29  0:18         ` Philippe Wang
@ 2006-11-29  1:48           ` Martin Jambon
  2006-11-29 15:26             ` Philippe Wang
  2006-11-29 17:52             ` Diego Olivier FERNANDEZ PONS
  2006-11-29 17:25           ` brogoff
  1 sibling, 2 replies; 19+ messages in thread
From: Martin Jambon @ 2006-11-29  1:48 UTC (permalink / raw)
  To: Philippe Wang; +Cc: caml-list

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1380 bytes --]

On Wed, 29 Nov 2006, Philippe Wang wrote:

> Martin Jambon a écrit :
>
>> You should definitely have a look at micmatch. It's backslash free!
>> 
>> main page:  http://martin.jambon.free.fr/micmatch.html
>> tutorial:   http://martin.jambon.free.fr/micmatch-howto.html
>> reference:  http://martin.jambon.free.fr/micmatch-manual.html
>
> But isn't that making things "different again"?

You can't make things better without making them different. OCaml is about 
being better, and so is the syntax I chose for regexps. It is fully
compatible with the syntax used by ocamllex, and I must say ocamllex 
regexps are incredibly easy to learn and to use. I never had any problem 
with them. In comparison Str or PCRE regexps are truly horrible.

> I know so many people that do not want to use OCaml just because its syntax 
> is (very) "different"...

I don't think that those people would be more satisfied with another 
syntax anyway, because OCaml would still be different! It's just that 
average people are afraid of anything that is different from what they 
already know.

> (don't tell me about the alternative syntax, which is - to me - an 
> "horror"...)

OK. Here is what I propose to whoever thinks OCaml's syntax is not 
good: give me a *complete* description of the syntax that you want and 
I'll implement it.


Martin

--
Martin Jambon, PhD
http://martin.jambon.free.fr

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-29  1:48           ` Martin Jambon
@ 2006-11-29 15:26             ` Philippe Wang
  2006-11-29 17:52             ` Diego Olivier FERNANDEZ PONS
  1 sibling, 0 replies; 19+ messages in thread
From: Philippe Wang @ 2006-11-29 15:26 UTC (permalink / raw)
  To: Martin Jambon; +Cc: caml-list

Hello,

> You can't make things better without making them different. OCaml is 
> about being better, and so is the syntax I chose for regexps. It is fully
> compatible with the syntax used by ocamllex, and I must say ocamllex 
> regexps are incredibly easy to learn and to use. I never had any problem 
> with them. In comparison Str or PCRE regexps are truly horrible.

Maybe if regexps are taken to first class values (at least in the 
syntax, whatever what is done behind...), like in Perl, then it'll be 
easily usable. Well, I will look with more attention to micmatch, maybe 
it's actually really easy to handle it.

I will think about it when I have time for that.

> I don't think that those people would be more satisfied with another 
> syntax anyway, because OCaml would still be different! It's just that 
> average people are afraid of anything that is different from what they 
> already know.

In deed, you're probably right. Still I hope not.


> OK. Here is what I propose to whoever thinks OCaml's syntax is not good: 
> give me a *complete* description of the syntax that you want and I'll 
> implement it.

That's really hard :-D

I like the OCaml syntax very much (I must be crazy :-D)
(but definitely not the one of "Camlp4 Chapter 6 : The Revised syntax")


--
Philippe Wang



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-29  0:18         ` Philippe Wang
  2006-11-29  1:48           ` Martin Jambon
@ 2006-11-29 17:25           ` brogoff
  2006-11-29 18:10             ` Philippe Wang
  2006-11-29 21:20             ` Jon Harrop
  1 sibling, 2 replies; 19+ messages in thread
From: brogoff @ 2006-11-29 17:25 UTC (permalink / raw)
  To: caml-list

On Wed, 29 Nov 2006, Philippe Wang wrote:
> (don't tell me about the alternative syntax, which is - to me - an
> "horror"...)

That would be a more interesting comment if you gave some reasons
as to why you believe that. I prefer the Revised syntax, for reasons
of overall consistency and because it removes a few gotchas, but for
various nontechnical reasons (tiny user community, questions about the
future of CamlP4 and the level of support for it, etc.) would not
switch over.

-- Brian


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-29  1:48           ` Martin Jambon
  2006-11-29 15:26             ` Philippe Wang
@ 2006-11-29 17:52             ` Diego Olivier FERNANDEZ PONS
  1 sibling, 0 replies; 19+ messages in thread
From: Diego Olivier FERNANDEZ PONS @ 2006-11-29 17:52 UTC (permalink / raw)
  To: Martin Jambon; +Cc: caml-list

     Bonjour

> OK. Here is what I propose to whoever thinks OCaml's syntax is not
> good: give me a *complete* description of the syntax that you want and
> I'll implement it.

Haskell Weekly News: September 27, 2006
Quotes of the Week:

vincenz : "OCaml used to be pretty, Haskell made it ugly"

         Diego Olivier


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-29 17:25           ` brogoff
@ 2006-11-29 18:10             ` Philippe Wang
  2006-11-30  2:30               ` skaller
  2006-11-29 21:20             ` Jon Harrop
  1 sibling, 1 reply; 19+ messages in thread
From: Philippe Wang @ 2006-11-29 18:10 UTC (permalink / raw)
  To: brogoff; +Cc: caml-list

brogoff a écrit :

> That would be a more interesting comment if you gave some reasons
> as to why you believe that. I prefer the Revised syntax, for reasons
> of overall consistency and because it removes a few gotchas, but for
> various nontechnical reasons (tiny user community, questions about the
> future of CamlP4 and the level of support for it, etc.) would not
> switch over.

Maybe it's because I know the standard syntax quite well.
Or maybe because there are some things that are too weird in the revised 
syntax, like lists stuff.

Like that :

OCaml		Revised
x::y::z::t	[x::[y::[z::t]]]
x::y::z::t	[x; y; z :: t]

=> It's too weird for me.

The reversed notation for types : I don't like it either.
(maybe just because I'm not used to that)

In declaration of a concrete type, brackets must enclose the constructor 
declarations:
OCaml	Revised
type t = A of i | B;;	type t = [ A of i | B ];
Why is it so much better to add brackets? To me they are useless...
Do they really make things clearer for some people?

Well, I am not going to say all I like and all I don't.
Of course there things that are potentially "better", like parenthesis 
around tuples. But I prefer not having to put them systematically.
There are good ideas in the revised syntax, but it doesn't fit my tastes 8-)

--
Philippe Wang


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-29 17:25           ` brogoff
  2006-11-29 18:10             ` Philippe Wang
@ 2006-11-29 21:20             ` Jon Harrop
  2006-11-29 21:25               ` Till Varoquaux
  2006-12-01  0:12               ` brogoff
  1 sibling, 2 replies; 19+ messages in thread
From: Jon Harrop @ 2006-11-29 21:20 UTC (permalink / raw)
  To: caml-list

On Wednesday 29 November 2006 17:25, brogoff wrote:
> questions about the future of CamlP4

I thought the upcoming, revamped camlp4 was one of the hotly anticipated new 
features scheduled for OCaml 4?

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-29 21:20             ` Jon Harrop
@ 2006-11-29 21:25               ` Till Varoquaux
  2006-12-01  0:12               ` brogoff
  1 sibling, 0 replies; 19+ messages in thread
From: Till Varoquaux @ 2006-11-29 21:25 UTC (permalink / raw)
  To: Jon Harrop; +Cc: caml-list

On 11/29/06, Jon Harrop <jon@ffconsultancy.com> wrote:
> On Wednesday 29 November 2006 17:25, brogoff wrote:
> > questions about the future of CamlP4
>
> I thought the upcoming, revamped camlp4 was one of the hotly anticipated new
> features scheduled for OCaml 4?
Scheduled for ocaml 3.10...
>
> --
> Dr Jon D Harrop, Flying Frog Consultancy Ltd.
> Objective CAML for Scientists
> http://www.ffconsultancy.com/products/ocaml_for_scientists
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-29 18:10             ` Philippe Wang
@ 2006-11-30  2:30               ` skaller
  2006-11-30 18:20                 ` Tom
  0 siblings, 1 reply; 19+ messages in thread
From: skaller @ 2006-11-30  2:30 UTC (permalink / raw)
  To: Philippe Wang; +Cc: brogoff, caml-list

On Wed, 2006-11-29 at 19:10 +0100, Philippe Wang wrote:
> brogoff a écrit :
> 
> > That would be a more interesting comment if you gave some reasons
> > as to why you believe that. I prefer the Revised syntax, for reasons
> > of overall consistency and because it removes a few gotchas, but for
> > various nontechnical reasons (tiny user community, questions about the
> > future of CamlP4 and the level of support for it, etc.) would not
> > switch over.
> 
> Maybe it's because I know the standard syntax quite well.
> Or maybe because there are some things that are too weird in the revised 
> syntax, like lists stuff.

What might actually be interesting and useful is standard conforming
Standard MetaLanguage (SML) syntax, or a good subset of it.

I wonder how far that could go? Is there anything in SML that
you can't do in Ocaml with similar enough syntax that Camlp4
could cope with it?

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-30  2:30               ` skaller
@ 2006-11-30 18:20                 ` Tom
  2006-12-01  3:21                   ` skaller
  0 siblings, 1 reply; 19+ messages in thread
From: Tom @ 2006-11-30 18:20 UTC (permalink / raw)
  To: skaller; +Cc: Philippe Wang, caml-list, brogoff

[-- Attachment #1: Type: text/plain, Size: 1157 bytes --]

>
>
> I wonder how far that could go? Is there anything in SML that
> you can't do in Ocaml with similar enough syntax that Camlp4
> could cope with it?
>

For me, personally, the question is not whether it can be done, but whether
I want it or not!

I am used to OCaml and don't want to switch to the unfamiliar, somewhat
strange syntax of SML. The webpage
http://www.ps.uni-sb.de/~rossberg/SMLvsOcaml.html<http://www.ps.uni-sb.de/%7Erossberg/SMLvsOcaml.html>gives
a (seemingly) thorough comparision between SML and OCaml (both syntax
and language features are compared). The following are only some of the
things I would only hardly be able to cope with:

characters written as #"J" instead of 'J',
fn x => e instead of fun x -> e
case of instead of match with
different declarations for values and functions (val, fun, in OCaml only
let)
datatype instead of type, plus eqtypes
strance multiple values definition

These are only minor differences, but if one is accustumed to one taste, one
would suffer when forcefully introduced to another one.

By the way, there are also some strange syntax structures introduced by
camlp4 that I don't like...

- Tom

[-- Attachment #2: Type: text/html, Size: 1404 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-29 21:20             ` Jon Harrop
  2006-11-29 21:25               ` Till Varoquaux
@ 2006-12-01  0:12               ` brogoff
  1 sibling, 0 replies; 19+ messages in thread
From: brogoff @ 2006-12-01  0:12 UTC (permalink / raw)
  To: caml-list

On Wed, 29 Nov 2006, Jon Harrop wrote:
> On Wednesday 29 November 2006 17:25, brogoff wrote:
> > questions about the future of CamlP4
>
> I thought the upcoming, revamped camlp4 was one of the hotly anticipated new
> features scheduled for OCaml 4?

It's for OCaml 3.10, as mentioned, and while I look forward to it, the
fact that it is still a second class tool (compare to ocamldoc, ocamldebug,
or even ocamllex/ocamlyacc) causes me to view it a bit suspiciously. By
"second class" I don't mean to impugn the quality of the tool here.

OCaml is not mainstream, and I'm reluctant to make it even less so where
I work by using an alternative syntax enabled by a second class tool.

-- Brian


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-11-30 18:20                 ` Tom
@ 2006-12-01  3:21                   ` skaller
  2006-12-01  6:48                     ` Tom
  0 siblings, 1 reply; 19+ messages in thread
From: skaller @ 2006-12-01  3:21 UTC (permalink / raw)
  To: Tom; +Cc: caml-list, Philippe Wang, brogoff

On Thu, 2006-11-30 at 19:20 +0100, Tom wrote:
>         
>         I wonder how far that could go? Is there anything in SML that
>         you can't do in Ocaml with similar enough syntax that Camlp4 
>         could cope with it?
> 
> For me, personally, the question is not whether it can be done, but
> whether I want it or not!

The point is to reuse existing SML code -- not write you
new code in SML, though it may be useful to do that
sometimes too.

For example, if you want high performance you might want
the option of using the whole program analyser Mlton
for the final product, but use Ocaml for development.

I actually have a vague interest in that. At least in part,
being able to use a *standardised* syntax, good or not,
may offer some advantages.

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Caml-list] About the O'Reilly book on the web
  2006-12-01  3:21                   ` skaller
@ 2006-12-01  6:48                     ` Tom
  0 siblings, 0 replies; 19+ messages in thread
From: Tom @ 2006-12-01  6:48 UTC (permalink / raw)
  To: skaller; +Cc: caml-list, Philippe Wang, brogoff

[-- Attachment #1: Type: text/plain, Size: 80 bytes --]

Hm.... but what about the libraries and the semantic incompatibilities?

 - Tom

[-- Attachment #2: Type: text/html, Size: 95 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2006-12-01  6:48 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-25 18:38 About the O'Reilly book on the web Francois Colonna
2006-11-27  9:07 ` [Caml-list] " Sebastien Ferre
2006-11-28 21:01   ` Philippe Wang
2006-11-28 22:33     ` Till Varoquaux
2006-11-28 22:47       ` Martin Jambon
2006-11-29  0:18         ` Philippe Wang
2006-11-29  1:48           ` Martin Jambon
2006-11-29 15:26             ` Philippe Wang
2006-11-29 17:52             ` Diego Olivier FERNANDEZ PONS
2006-11-29 17:25           ` brogoff
2006-11-29 18:10             ` Philippe Wang
2006-11-30  2:30               ` skaller
2006-11-30 18:20                 ` Tom
2006-12-01  3:21                   ` skaller
2006-12-01  6:48                     ` Tom
2006-11-29 21:20             ` Jon Harrop
2006-11-29 21:25               ` Till Varoquaux
2006-12-01  0:12               ` brogoff
2006-11-28 23:07       ` Philippe Wang

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