caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [ANN] cppo 0.9.2 - cpp for OCaml
@ 2011-08-12  9:44 Martin Jambon
  2011-08-12 22:16 ` Alexy Khrabrov
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Jambon @ 2011-08-12  9:44 UTC (permalink / raw)
  To: OCaml Mailing List

Dear list,

I would like to announce the release of cppo 0.9.2 which contains a few
additional features since the last announcement in 2009.

  http://martin.jambon.free.fr/cppo.html

cppo is a lightweight preprocessor analogous to cpp and compatible with
the OCaml syntax. It provides the classic directives #define, #include,
#ifdef, etc.

Documentation: http://martin.jambon.free.fr/cppo-manual-0.9.2.txt


New features:

1. #ext directive: calling external preprocessors
2. STRINGIFY and CONCAT


1. #ext directive: calling external preprocessors
=================================================

The new #ext directive allows to call an external command to process a
lines of input until #endext.

$ cat example1.ml
let msg =
#ext rot13
  "BPnzy ehyrf!"
#endext

let () = print_endline msg

$ ocamlopt -o example1 \
  -pp "cppo -x rot13:\"tr '[a-zA-Z]' '[n-za-mN-ZA-M]'\"" example1.ml

$ ./example1
OCaml rules!


2. STRINGIFY and CONCAT
=======================

STRINGIFY allows to build string literals from unquoted text. This is
useful for including source code in error messages. STRINGIFY(foo) is
the equivalent of #foo in cpp syntax.

CONCAT concatenates its two arguments into a single identifier.
CONCAT(a, b) is the equivalent of a ## b in cpp syntax.



Enjoy.


Martin

--

P.S.: follow my tech-focused channel on Twitter for more organic news:

  http://twitter.com/mjambontech

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

* Re: [Caml-list] [ANN] cppo 0.9.2 - cpp for OCaml
  2011-08-12  9:44 [Caml-list] [ANN] cppo 0.9.2 - cpp for OCaml Martin Jambon
@ 2011-08-12 22:16 ` Alexy Khrabrov
  2011-08-13  6:30   ` Raphael Proust
  2011-08-13  7:26   ` Martin Jambon
  0 siblings, 2 replies; 4+ messages in thread
From: Alexy Khrabrov @ 2011-08-12 22:16 UTC (permalink / raw)
  To: Martin Jambon; +Cc: OCaml Mailing List

Perhaps it should be called opp?  Or does c stand for "compatible
preprocessor for ocaml"? :)

A+

On Fri, Aug 12, 2011 at 2:44 AM, Martin Jambon
<martin.jambon@ens-lyon.org> wrote:
> Dear list,
>
> I would like to announce the release of cppo 0.9.2 which contains a few
> additional features since the last announcement in 2009.
>
>  http://martin.jambon.free.fr/cppo.html
>
> cppo is a lightweight preprocessor analogous to cpp and compatible with
> the OCaml syntax. It provides the classic directives #define, #include,
> #ifdef, etc.
>
> Documentation: http://martin.jambon.free.fr/cppo-manual-0.9.2.txt
>
>
> New features:
>
> 1. #ext directive: calling external preprocessors
> 2. STRINGIFY and CONCAT
>
>
> 1. #ext directive: calling external preprocessors
> =================================================
>
> The new #ext directive allows to call an external command to process a
> lines of input until #endext.
>
> $ cat example1.ml
> let msg =
> #ext rot13
>  "BPnzy ehyrf!"
> #endext
>
> let () = print_endline msg
>
> $ ocamlopt -o example1 \
>  -pp "cppo -x rot13:\"tr '[a-zA-Z]' '[n-za-mN-ZA-M]'\"" example1.ml
>
> $ ./example1
> OCaml rules!
>
>
> 2. STRINGIFY and CONCAT
> =======================
>
> STRINGIFY allows to build string literals from unquoted text. This is
> useful for including source code in error messages. STRINGIFY(foo) is
> the equivalent of #foo in cpp syntax.
>
> CONCAT concatenates its two arguments into a single identifier.
> CONCAT(a, b) is the equivalent of a ## b in cpp syntax.
>
>
>
> Enjoy.
>
>
> Martin
>
> --
>
> P.S.: follow my tech-focused channel on Twitter for more organic news:
>
>  http://twitter.com/mjambontech
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/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] 4+ messages in thread

* Re: [Caml-list] [ANN] cppo 0.9.2 - cpp for OCaml
  2011-08-12 22:16 ` Alexy Khrabrov
@ 2011-08-13  6:30   ` Raphael Proust
  2011-08-13  7:26   ` Martin Jambon
  1 sibling, 0 replies; 4+ messages in thread
From: Raphael Proust @ 2011-08-13  6:30 UTC (permalink / raw)
  To: Alexy Khrabrov; +Cc: Martin Jambon, OCaml Mailing List

On Fri, Aug 12, 2011 at 11:16 PM, Alexy Khrabrov <deliverable@gmail.com> wrote:
> Perhaps it should be called opp?  Or does c stand for "compatible
> preprocessor for ocaml"? :)

If you want it to be reachable using search engines on the Web (and
gives less importance to acronyms/backronyms) cppo is better than opp.

As an illustration:
https://duckduckgo.com/?q=opp
https://duckduckgo.com/?q=cppo

>
> A+
>
> On Fri, Aug 12, 2011 at 2:44 AM, Martin Jambon
> <martin.jambon@ens-lyon.org> wrote:
>> Dear list,
>>
>> I would like to announce the release of cppo 0.9.2 which contains a few
>> additional features since the last announcement in 2009.
>>
>>  http://martin.jambon.free.fr/cppo.html
>>
>> cppo is a lightweight preprocessor analogous to cpp and compatible with
>> the OCaml syntax. It provides the classic directives #define, #include,
>> #ifdef, etc.
>>
>> Documentation: http://martin.jambon.free.fr/cppo-manual-0.9.2.txt
>>
>>
>> New features:
>>
>> 1. #ext directive: calling external preprocessors
>> 2. STRINGIFY and CONCAT
>>
>>
>> 1. #ext directive: calling external preprocessors
>> =================================================
>>
>> The new #ext directive allows to call an external command to process a
>> lines of input until #endext.
>>
>> $ cat example1.ml
>> let msg =
>> #ext rot13
>>  "BPnzy ehyrf!"
>> #endext
>>
>> let () = print_endline msg
>>
>> $ ocamlopt -o example1 \
>>  -pp "cppo -x rot13:\"tr '[a-zA-Z]' '[n-za-mN-ZA-M]'\"" example1.ml
>>
>> $ ./example1
>> OCaml rules!
>>
>>
>> 2. STRINGIFY and CONCAT
>> =======================
>>
>> STRINGIFY allows to build string literals from unquoted text. This is
>> useful for including source code in error messages. STRINGIFY(foo) is
>> the equivalent of #foo in cpp syntax.
>>
>> CONCAT concatenates its two arguments into a single identifier.
>> CONCAT(a, b) is the equivalent of a ## b in cpp syntax.
>>
>>
>>
>> Enjoy.
>>
>>
>> Martin
>>
>> --
>>
>> P.S.: follow my tech-focused channel on Twitter for more organic news:
>>
>>  http://twitter.com/mjambontech
>>
>> --
>> Caml-list mailing list.  Subscription management and archives:
>> https://sympa-roc.inria.fr/wws/info/caml-list
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>>
>>
>
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
>



-- 
_______
Raphael


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

* Re: [Caml-list] [ANN] cppo 0.9.2 - cpp for OCaml
  2011-08-12 22:16 ` Alexy Khrabrov
  2011-08-13  6:30   ` Raphael Proust
@ 2011-08-13  7:26   ` Martin Jambon
  1 sibling, 0 replies; 4+ messages in thread
From: Martin Jambon @ 2011-08-13  7:26 UTC (permalink / raw)
  To: Alexy Khrabrov; +Cc: OCaml Mailing List

On 08/12/11 15:16, Alexy Khrabrov wrote:
> Perhaps it should be called opp?  Or does c stand for "compatible
> preprocessor for ocaml"? :)

ocpp was already taken by a camlp4 tool.
I don't remember exactly why I didn't like opp. Maybe because O.P.P.
sounds bad.
I remember feeling good about cppo because it starts with cpp and
because the pronunciation is unambiguous.


Martin

> A+
> 
> On Fri, Aug 12, 2011 at 2:44 AM, Martin Jambon
> <martin.jambon@ens-lyon.org> wrote:
>> Dear list,
>>
>> I would like to announce the release of cppo 0.9.2 which contains a few
>> additional features since the last announcement in 2009.
>>
>>  http://martin.jambon.free.fr/cppo.html
>>
>> cppo is a lightweight preprocessor analogous to cpp and compatible with
>> the OCaml syntax. It provides the classic directives #define, #include,
>> #ifdef, etc.
>>
>> Documentation: http://martin.jambon.free.fr/cppo-manual-0.9.2.txt
>>
>>
>> New features:
>>
>> 1. #ext directive: calling external preprocessors
>> 2. STRINGIFY and CONCAT
>>
>>
>> 1. #ext directive: calling external preprocessors
>> =================================================
>>
>> The new #ext directive allows to call an external command to process a
>> lines of input until #endext.
>>
>> $ cat example1.ml
>> let msg =
>> #ext rot13
>>  "BPnzy ehyrf!"
>> #endext
>>
>> let () = print_endline msg
>>
>> $ ocamlopt -o example1 \
>>  -pp "cppo -x rot13:\"tr '[a-zA-Z]' '[n-za-mN-ZA-M]'\"" example1.ml
>>
>> $ ./example1
>> OCaml rules!
>>
>>
>> 2. STRINGIFY and CONCAT
>> =======================
>>
>> STRINGIFY allows to build string literals from unquoted text. This is
>> useful for including source code in error messages. STRINGIFY(foo) is
>> the equivalent of #foo in cpp syntax.
>>
>> CONCAT concatenates its two arguments into a single identifier.
>> CONCAT(a, b) is the equivalent of a ## b in cpp syntax.
>>
>>
>>
>> Enjoy.
>>
>>
>> Martin
>>
>> --
>>
>> P.S.: follow my tech-focused channel on Twitter for more organic news:
>>
>>  http://twitter.com/mjambontech
>>
>> --
>> Caml-list mailing list.  Subscription management and archives:
>> https://sympa-roc.inria.fr/wws/info/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] 4+ messages in thread

end of thread, other threads:[~2011-08-13  7:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-12  9:44 [Caml-list] [ANN] cppo 0.9.2 - cpp for OCaml Martin Jambon
2011-08-12 22:16 ` Alexy Khrabrov
2011-08-13  6:30   ` Raphael Proust
2011-08-13  7:26   ` Martin Jambon

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