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.

http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html

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

	Andy
Received on Wednesday, 24 November 2010 20:58:10 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:44 GMT