caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dario Teixeira <darioteixeira@yahoo.com>
To: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] [ANN] CCSS 1.0
Date: Thu, 11 Mar 2010 11:00:51 -0800 (PST)	[thread overview]
Message-ID: <270464.41732.qm@web111505.mail.gq1.yahoo.com> (raw)
In-Reply-To: <91a3da521003110654x37d8a551u948c39889b64fdba@mail.gmail.com>

Hi,

> The problem is that different kind of objects naturally use different
> kind of units. A font size or line height for example is usually
> expressed in pts and a standard paper or photographic print size will
> be in cms (or inches).

Sure, and nothing stops you from using those different units in different
contexts.  CCSS only constrains you if you try doing *arithmetic* with
those units, which I posit should rarely be an issue, precisely because
they live in different contexts.

But anyway, I've implemented unit conversion, which you can find in SVN [1].
In the next release this feature may be activated at user discretion.

Units are divided into four categories, and units within the same category
may be mixed.  The result gets the same unit as the first operand.  The
categories are as follows:

   length: mm, cm, in, pt, pc
    angle: deg, grad, rad
     time: ms, s
frequency: hz, khz

In the following example, the output for all properties will be "2in":

h1
  {
  foo1: 1in + 1in;
  foo2: 1in + 2.54cm;
  foo3: 1in + 25.4mm;
  foo4: 1in + 72pt;
  foo5: 1in + 6pc;
  }


Best regards,
Dario Teixeira

[1] http://forge.ocamlcore.org/scm/viewvc.php/?root=ccss






  reply	other threads:[~2010-03-11 19:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-10 19:16 Dario Teixeira
2010-03-10 21:09 ` [Caml-list] " Daniel Bünzli
2010-03-11 13:34   ` Dario Teixeira
2010-03-11 14:54     ` Daniel Bünzli
2010-03-11 19:00       ` Dario Teixeira [this message]
2010-03-12 13:10         ` Daniel Bünzli
2010-03-12 15:43           ` Dario Teixeira

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=270464.41732.qm@web111505.mail.gq1.yahoo.com \
    --to=darioteixeira@yahoo.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=daniel.buenzli@erratique.ch \
    /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).