W3C home > Mailing lists > Public > www-style@w3.org > July 2014

Re: [css-values-4] String concatenation

From: Liam R E Quin <liam@w3.org>
Date: Tue, 22 Jul 2014 17:54:44 -0400
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: François REMY <francois.remy.dev@outlook.com>, Christoph Päper <christoph.paeper@crissov.de>, www-style list <www-style@w3.org>
Message-ID: <20140722175444.0ae05b6e.liam@w3.org>
On Tue, 22 Jul 2014 14:14:51 -0700
"Tab Atkins Jr." <jackalmage@gmail.com> wrote:

> On Tue, Jul 22, 2014 at 9:47 AM, François REMY

> > We can however do the exact same thing within "calc".
> >
> >    calc("a" + "b") // "ab"
> >
> > But it means that calc() may end up having different types depending on its
> > content (albeit it is possible to know it at parse time)
> 
> Already completely true - calc() can represent a <number>, an
> <integer>, a <length>, etc depending on its contents.

You also have to consider what calc(attr("data-quantity") + 1) should do,
(1) if data-quantity has the value "hello"
(2) if data-quantity has the value "6"
and (3) if you our answers to 1 and 2 are different in nature, how do we guarantee string concatenation when the att value appears numeric, or, how do we get addition?
(4) if the data-quantity has the value "14 cathedrals" should I get "15" back?

Liam


-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Received on Tuesday, 22 July 2014 21:54:48 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:23 UTC