More D newb questions.

Me Here p9e883002 at sneakemail.com
Tue May 6 14:59:14 PDT 2008


Steven Schveighoffer wrote:

> "Me Here" wrote
> 
> What about calling a function with the given concatenation?
> 
> f(MyArray ma);
> 
> f(a ~ b); // would this work?

Hm. I'm not sure. Would this work now: f( [ a, b ] ); ?

> 
> You would probably get there with opImplicitCast, but it seems rather
> inefficient to build a temporary array just to build a MyArray structure.

Is it so different from this?

	void f( double d ) { ...}
	f( 1 + 2 );

> 
> toupperInPlace(s[i..i+10]);
> 
> Should do exactly what you want.  If it existed :)
> 

And, of course, it does:

	void toUpper( char[] s ) {
	    int l = s.length;
	    for( int i = 0; i < l; s[ i++ ] &= ~0x20 ) {};
	}

And the rest of my pragmatic.string library is coming along also :)

> -Steve

Cheers, b.

-- 




More information about the Digitalmars-d mailing list