Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[ANN] CCSS 1.0
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-03-11 (13:34)
From: Dario Teixeira <darioteixeira@y...>
Subject: Re: [Caml-list] [ANN] CCSS 1.0

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

It's unit-aware in the sense that it knows that numeric values may have
this thing called "units" attached, and they impose some constraints on
arithmetic, but it knows nothing about the semantics and relation between

I understand why you may see this as a bug, but for me it's a feature.
Personal experience tells me that mixing units -- even if they belong
to the same system, as cm and mm -- is asking for trouble (never mind
mixing units from metric and imperial -- ask NASA).

While CCSS has no intention of being a CSS-lint, it does enforce a couple
of good-practices constraints.  Forbidding unit mixing is one of them;
another is ensuring each property declaration is terminated by a semicolon,
even if it's the last one: again, experience tells me that omitting it
is asking for trouble.

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

That will be a good point if CCSS ever becomes popular and you wish
to copy'n'paste CSS fragments augmented with its syntax.  But presently
that's a moot point, since the CSS fragments you find in the wild are not
augmented with variable declarations and/or arithmetic.

But anyway, if you really think unit conversion is a must-have feature,
I can add it to the next release (it's actually simple to implement).
However, personally I remain sceptical about its real-world usefulness.

Best regards,
Dario Teixeira