From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 1A555BBAF for ; Wed, 10 Mar 2010 22:09:29 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqkCALOZl0vRVdvgimdsb2JhbACDC5dBCBUBAQEKCQwHEQUfq0KCF4UTiHcBAQMFgS2CXWoEjCE X-IronPort-AV: E=Sophos;i="4.49,616,1262559600"; d="scan'208";a="46311126" Received: from mail-ew0-f224.google.com ([209.85.219.224]) by mail3-smtp-sop.national.inria.fr with ESMTP; 10 Mar 2010 22:09:28 +0100 Received: by ewy24 with SMTP id 24so2004355ewy.7 for ; Wed, 10 Mar 2010 13:09:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=BNHNkRgjyxHuHW3zU1kDdln89VI18wFNOyLRGDHbDBw=; b=FOnoQhanm6gl3stb+4nIYWIgD2ZIt54PUKQ988dGROw1CD06Bv4UnKiwAMg2yLNzGU uVCyqVf0p5lYr4/EMw2PfgC+b/vgrYl0J/W8j5rgKhMSBPOX3KCmqnhqQ6ekgyfNQ2EV bvT2ng7ItDWxLOP4AKbD1AjHj9LKwlNLa/ybM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=gjZxI7Ylq2Mandi/Pz09wBlACu5UxXE77B6rqh9XKvAaCtBviD0WxLh7/6YAMJYORn SRGdicOhQs0eBdkoTmFKc9q3sq4YNVHaRZ8rER+Hgrwn7bhgrWvcbxWEXtBgIM5D/CtD dqdf8qk2Zpbm33ycu92/LLj9SqDVjYEiXgzI0= MIME-Version: 1.0 Sender: daniel.c.buenzli@gmail.com Received: by 10.213.26.138 with SMTP id e10mr1360245ebc.80.1268255362447; Wed, 10 Mar 2010 13:09:22 -0800 (PST) In-Reply-To: <178425.29275.qm@web111506.mail.gq1.yahoo.com> References: <178425.29275.qm@web111506.mail.gq1.yahoo.com> Date: Wed, 10 Mar 2010 22:09:22 +0100 X-Google-Sender-Auth: b03a18352d5ebf16 Message-ID: <91a3da521003101309n5eadf89dt7e6e157e3dd14a3@mail.gmail.com> Subject: Re: [Caml-list] [ANN] CCSS 1.0 From: =?UTF-8?Q?Daniel_B=C3=BCnzli?= To: Dario Teixeira Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; buenzli:01 snippets:01 syntax:01 1.0:98 preprocessor:01 incompatible:01 caml-list:01 functions:01 normalize:01 arithmetic:01 arithmetic:01 font:97 expression:02 expression:02 exp:02 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. > =C2=A0- The arithmetic operations are unit-aware, and will complain if yo= u > =C2=A0 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