W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2010

Re: function library summary and issues

From: Andy Seaborne <andy.seaborne@epimorphics.com>
Date: Wed, 24 Nov 2010 20:57:30 +0000
Message-ID: <4CED7C3A.7010600@epimorphics.com>
To: Steve Harris <steve.harris@garlik.com>
CC: Gregory Williams <greg@evilfunhouse.com>, SPARQL Working Group <public-rdf-dawg@w3.org>
> Even some strongly typed languages have this sort of oddity, e.g. Java's StringBuffer.append() appears to take a bunch of types as an argument, but + only works on pairs of numeric types, or strings, as far as I can tell. Not being a java user, I don't know how this pans out in practice.


+ works on strings if the LHS is a string.
It is exactly StringBuffer.append.
Oddly, it makes that use of "+" non-commutative.

The RHS is converted to a string by (1) whatever the base type 
conversion is (int, long, etc) or (2) Object.toString().

         String x = ""+1+2 ;
	the string "12"

That's not a good for SPARQL IMO, where just string+string -> string is 

Received on Wednesday, 24 November 2010 20:58:10 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:01:02 UTC