<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Since our LSL implementation (still) is based on substitution; and some things are harder to substitute than others, the 'OSSL way of doing it' would probably be to write<BR>
 <BR>
f = float.Parse(s);<BR><BR>
instead<BR>
 <BR>
Of course, if any of the LSL implementors would want to toy around with it, substituting "(\s*float\s*)" with something like "(OSSLFloat)" and then implementing an OSSLFloat class as a float wrapper, with some implicit cast operators, would probably float the boat.<BR>
 <BR>
of course, the same thing goes for the othe numeric types as well. You might even want to create a generic numeric wrapper OSSLNumeric<T>.<BR>
 <BR>
Best,<BR>
/Stefan<BR><BR>

<HR id=stopSpelling>
<BR>
> Date: Wed, 23 Apr 2008 09:30:41 +0100<BR>> From: jjustincc@googlemail.com<BR>> To: opensim-dev@lists.berlios.de<BR>> Subject: Re: [Opensim-dev] Question about OSSL type conversion<BR>> <BR>> Eric wrote:<BR>> > Hi everyone,<BR>> > <BR>> > I've noticed that numerous type conversions in OSSL are not <BR>> > functioning. Typecasting such as:<BR>> > <BR>> > float f = 1.234;<BR>> > string s = (string)f;<BR>> > f = (float)s;<BR>> > <BR>> > generates a CS0030 compiler error (cannot convert from 'string' to <BR>> > 'double'). It seems that there are conversion methods from numeric and <BR>> > complex (such as vector) types to string, but not the other way around.<BR>> > <BR>> > Is this a known issue? Is there a way to perform these conversions <BR>> > aside from typecasting?<BR>> <BR>> I can't remember seeing this in the Mantis database, so you might want <BR>> to put an entry in there.<BR>> <BR>> I'm not sure there is any other way to do this apart from casting, but <BR>> my knowledge of LSL is fairly rusty.<BR>> <BR>> -- <BR>> justincc<BR>> Justin Clark-Casey<BR>> http://justincc.wordpress.com<BR>> _______________________________________________<BR>> Opensim-dev mailing list<BR>> Opensim-dev@lists.berlios.de<BR>> https://lists.berlios.de/mailman/listinfo/opensim-dev<BR><BR></body>
</html>