Generic const - a non-functional view

Me Here p9e883002 at sneakemail.com
Thu Jun 26 18:18:06 PDT 2008


Dee Girl wrote:

> Me Here Wrote:
> > Perhaps you will find this a more convincing demonstration:
> > 
> >     [0] Perl> $s = 'the quick brown fox';;
> >     [0] Perl> $r = \substr $s, 10, 5;;
> >     [0] Perl> $$r = 'green';;
> >     [0] Perl> print $s;;
> >     the quick green fox
> 
> I stand corrected. As could your manners ^_^.

Sorry if you find my directness to be 'rude', but making assumptions based on
your guesswork about trivial eveidence and then propounding conclusions as if
they were facts, does not engender me to de indirect.

> 
> This is good example. Trick of taking a reference to result of substr is new
> to me. Very interesting even when I made $$r = "very long string" x 100 it
> still works. The number of characters can be different. How they do it?

It wasn't easy. But, if you look back to the earlier thread where I
demonstrated the in-place insertions and deletions are achieved through the use
of a pointer, length and offset, it should be clearer.

> 
> Maybe now D is more better compared to Perl because in D you can not make
> aliased changes to string! Thanks for teaching me. Dee Girl

Welcome, b.

-- 




More information about the Digitalmars-d mailing list