caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Checking support for string concatenation by OCaml
@ 2017-11-21 16:10 SF Markus Elfring
  2017-11-21 16:15 ` Nicolás Ojeda Bär
  0 siblings, 1 reply; 7+ messages in thread
From: SF Markus Elfring @ 2017-11-21 16:10 UTC (permalink / raw)
  To: caml-list

Hello,

The programming language “OCaml” supports the concatenation of strings by
a few interfaces.

Two of them like “Printf.sprintf” and “String.concat” are documented to some degree.
I wonder about the current situation around the operator “^”.

* Is a more useful explanation missing in the official OCaml manual?
  https://caml.inria.fr/pub/docs/manual-ocaml/coreexamples.html#sec9
  https://caml.inria.fr/pub/docs/manual-ocaml/lex.html#sec82

* It is mentioned in the section “Optional Arguments” of the book “Real World OCaml”.
  https://realworldocaml.org/v1/en/html/variables-and-functions.html#idm181619803616

* Syntax comparison
  http://rigaux.org/language-study/syntax-across-languages/Strng.html#StrngStrnCnct

Regards,
Markus

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

* Re: [Caml-list] Checking support for string concatenation by OCaml
  2017-11-21 16:10 [Caml-list] Checking support for string concatenation by OCaml SF Markus Elfring
@ 2017-11-21 16:15 ` Nicolás Ojeda Bär
  2017-11-21 16:28   ` SF Markus Elfring
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolás Ojeda Bär @ 2017-11-21 16:15 UTC (permalink / raw)
  To: SF Markus Elfring; +Cc: OCaml Mailing List

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

Hello,

It is documented in stdlib reference:

  https://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html

Best wishes,
Nicolás

On Tue, Nov 21, 2017 at 5:10 PM, SF Markus Elfring <
elfring@users.sourceforge.net> wrote:

> Hello,
>
> The programming language “OCaml” supports the concatenation of strings by
> a few interfaces.
>
> Two of them like “Printf.sprintf” and “String.concat” are documented to
> some degree.
> I wonder about the current situation around the operator “^”.
>
> * Is a more useful explanation missing in the official OCaml manual?
>   https://caml.inria.fr/pub/docs/manual-ocaml/coreexamples.html#sec9
>   https://caml.inria.fr/pub/docs/manual-ocaml/lex.html#sec82
>
> * It is mentioned in the section “Optional Arguments” of the book “Real
> World OCaml”.
>   https://realworldocaml.org/v1/en/html/variables-and-
> functions.html#idm181619803616
>
> * Syntax comparison
>   http://rigaux.org/language-study/syntax-across-languages/
> Strng.html#StrngStrnCnct
>
> Regards,
> Markus
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

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

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

* Re: [Caml-list] Checking support for string concatenation by OCaml
  2017-11-21 16:15 ` Nicolás Ojeda Bär
@ 2017-11-21 16:28   ` SF Markus Elfring
  2017-11-21 16:45     ` Yawar Amin
  0 siblings, 1 reply; 7+ messages in thread
From: SF Markus Elfring @ 2017-11-21 16:28 UTC (permalink / raw)
  To: Nicolás Ojeda Bär; +Cc: caml-list

> It is documented in stdlib reference:
> 
>   https://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html

Thanks for your link.

Would it be nice to repeat such information also at other places
in the provided documentation?

Are you interested to compare the run time characteristics from the usage
of the operator “^” (for string concatenation) to the other available
programming interfaces?

Regards,
Markus

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

* Re: [Caml-list] Checking support for string concatenation by OCaml
  2017-11-21 16:28   ` SF Markus Elfring
@ 2017-11-21 16:45     ` Yawar Amin
  2017-11-21 17:42       ` Gabriel Scherer
  0 siblings, 1 reply; 7+ messages in thread
From: Yawar Amin @ 2017-11-21 16:45 UTC (permalink / raw)
  To: SF Markus Elfring; +Cc: Nicolás Ojeda Bär, caml-list

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

Now that you mention it, `(^)` should really be defined in the `String`
module and then aliased from `Pervasives`. This seems like a reasonable PR
to send to the OCaml repo.

On Tue, Nov 21, 2017 at 11:28 AM, SF Markus Elfring <
elfring@users.sourceforge.net> wrote:

> > It is documented in stdlib reference:
> >
> >   https://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html
>
> Thanks for your link.
>
> Would it be nice to repeat such information also at other places
> in the provided documentation?
>
> Are you interested to compare the run time characteristics from the usage
> of the operator “^” (for string concatenation) to the other available
> programming interfaces?
>
> Regards,
> Markus
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

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

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

* Re: [Caml-list] Checking support for string concatenation by OCaml
  2017-11-21 16:45     ` Yawar Amin
@ 2017-11-21 17:42       ` Gabriel Scherer
  2017-11-21 19:22         ` Rodolphe Lepigre
  0 siblings, 1 reply; 7+ messages in thread
From: Gabriel Scherer @ 2017-11-21 17:42 UTC (permalink / raw)
  To: Yawar Amin; +Cc: SF Markus Elfring, Nicolás Ojeda Bär, caml users

This would create a cyclic dependency as String depends on Pervasives
(for (+), for example).

On Tue, Nov 21, 2017 at 5:45 PM, Yawar Amin <yawar.amin@gmail.com> wrote:
> Now that you mention it, `(^)` should really be defined in the `String`
> module and then aliased from `Pervasives`. This seems like a reasonable PR
> to send to the OCaml repo.
>
> On Tue, Nov 21, 2017 at 11:28 AM, SF Markus Elfring
> <elfring@users.sourceforge.net> wrote:
>>
>> > It is documented in stdlib reference:
>> >
>> >   https://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html
>>
>> Thanks for your link.
>>
>> Would it be nice to repeat such information also at other places
>> in the provided documentation?
>>
>> Are you interested to compare the run time characteristics from the usage
>> of the operator “^” (for string concatenation) to the other available
>> programming interfaces?
>>
>> Regards,
>> Markus
>>
>> --
>> Caml-list mailing list.  Subscription management and archives:
>> https://sympa.inria.fr/sympa/arc/caml-list
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
>

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

* Re: [Caml-list] Checking support for string concatenation by OCaml
  2017-11-21 17:42       ` Gabriel Scherer
@ 2017-11-21 19:22         ` Rodolphe Lepigre
  2017-11-22 10:18           ` David Allsopp
  0 siblings, 1 reply; 7+ messages in thread
From: Rodolphe Lepigre @ 2017-11-21 19:22 UTC (permalink / raw)
  To: Gabriel Scherer; +Cc: Caml list

On 21/11/17 18:42, Gabriel Scherer wrote:
> This would create a cyclic dependency as String depends on Pervasives
> (for (+), for example).

Speaking of which, it would be great to have an "Int" module in the standard
library to be able to write "Map.Make(Int)". Is there a reason why this has
not (yet) been done?

Of course, this also applies to "Float".

Cheers,
Rodolphe
-- 
Rodolphe Lepigre <rodolphe.lepigre@inria.fr>
Inria (Deducteam), LSV, CNRS, Université Paris-Saclay, FRANCE
https://lepigre.fr

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

* RE: [Caml-list] Checking support for string concatenation by OCaml
  2017-11-21 19:22         ` Rodolphe Lepigre
@ 2017-11-22 10:18           ` David Allsopp
  0 siblings, 0 replies; 7+ messages in thread
From: David Allsopp @ 2017-11-22 10:18 UTC (permalink / raw)
  To: Rodolphe Lepigre, Gabriel Scherer; +Cc: Caml list

Rodolphe Lepigre wrote:
> On 21/11/17 18:42, Gabriel Scherer wrote:
> > This would create a cyclic dependency as String depends on Pervasives
> > (for (+), for example).
> 
> Speaking of which, it would be great to have an "Int" module in the
> standard library to be able to write "Map.Make(Int)". Is there a reason
> why this has not (yet) been done?
> 
> Of course, this also applies to "Float".

Changes like this have become predicated on GPR#1010 (https://github.com/ocaml/ocaml/pull/1010), which is due to be merged soon(TM).


David 

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

end of thread, other threads:[~2017-11-22 10:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-21 16:10 [Caml-list] Checking support for string concatenation by OCaml SF Markus Elfring
2017-11-21 16:15 ` Nicolás Ojeda Bär
2017-11-21 16:28   ` SF Markus Elfring
2017-11-21 16:45     ` Yawar Amin
2017-11-21 17:42       ` Gabriel Scherer
2017-11-21 19:22         ` Rodolphe Lepigre
2017-11-22 10:18           ` David Allsopp

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