caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: Dario Teixeira <darioteixeira@yahoo.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] [ANN] CCSS 1.0
Date: Wed, 10 Mar 2010 22:09:22 +0100	[thread overview]
Message-ID: <91a3da521003101309n5eadf89dt7e6e157e3dd14a3@mail.gmail.com> (raw)
In-Reply-To: <178425.29275.qm@web111506.mail.gq1.yahoo.com>

Hello Dario,

> CCSS is a preprocessor for CSS (Cascading Style Sheets), extending the
> language with arithmetic operations and variables.

Yes, that's badly missing in CSS.

>  - The arithmetic operations are unit-aware, and will complain if you
>   try adding apples and oranges, for example.

Unit aware is good but the classes should be broader. I find it
disappointing that it won't allow you to add mm to cm correctly, since
it's supposed to be unit aware.

In CSS there are two kinds of units : relative and absolutes ones [1].
Each relative one should be in a different class as there are no known
conversion function between them (they depend on font metrics or on
the display). But all the absolute ones should be in the same class
and arithmetic between them should be performed correctly since the
conversion functions are known. I would thus suggest the following
incompatible classes of unit of measure :

* em
* ex
* px
* in, mm, cm, pt, pc

You'll need a convention for the unit of the result of an expression
with different absolute dimensions. A good way of achieving that would
be to use the unit of the leftmost term in the parse tree of the
expression, that way if you need to you can always get the unit you
want by writing e.g. 0mm + (exp).

>From a user perspective, it makes it much easier to copy paste
snippets from here and there without having to bother to normalize
every length to a single unit.

Other than that, the syntax you chose blends well with css.

Best,

Daniel

[1] http://www.w3.org/TR/CSS21/syndata.html#length-units


  reply	other threads:[~2010-03-10 21:09 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 ` Daniel Bünzli [this message]
2010-03-11 13:34   ` [Caml-list] " Dario Teixeira
2010-03-11 14:54     ` Daniel Bünzli
2010-03-11 19:00       ` Dario Teixeira
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=91a3da521003101309n5eadf89dt7e6e157e3dd14a3@mail.gmail.com \
    --to=daniel.buenzli@erratique.ch \
    --cc=caml-list@yquem.inria.fr \
    --cc=darioteixeira@yahoo.com \
    /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).