Re: [CVS ci] string_set is back for a faster live - not only

2002-11-07 Thread Leopold Toetsch
Peter Gibbs wrote: An extended version of my previous example follows, as it points out some more inconsistent behaviour. Here is a simple example, which shows inconsistent WRT strings: set S0, "not" set S1, S0 set S0, "ok" print S1 print "\n" new P0, .PerlString s

Re: [CVS ci] string_set is back for a faster live - not only

2002-11-07 Thread Leopold Toetsch
Brent Dax wrote: Leopold Toetsch: # The questions are (and this is IMHO the same problem with PMCs): # - set vs assign # - what should this program do This idea may be totally on crack, but why do we even have S and P registers as pointers? What if the S registers were basically just STRING[32]

Re: [CVS ci] string_set is back for a faster live - not only

2002-11-07 Thread Leopold Toetsch
Peter Gibbs wrote: Leopold Toetsch wrote: Fine. But how do we know, which version we could take. Please read again Peter's example. It depends on the semantics of Sx register usage all over the program IMHO. In an attempt to clarify the positions here, let us start with a shorter example:

RE: [CVS ci] string_set is back for a faster live - not only

2002-11-07 Thread Brent Dax
Leopold Toetsch: # The questions are (and this is IMHO the same problem with PMCs): # - set vs assign # - what should this program do This idea may be totally on crack, but why do we even have S and P registers as pointers? What if the S registers were basically just STRING[32] and the Ps were PM

Re: [CVS ci] string_set is back for a faster live - not only

2002-11-06 Thread Peter Gibbs
Leopold Toetsch wrote: > Fine. But how do we know, which version we could take. Please read again > Peter's example. It depends on the semantics of Sx register usage all > over the program IMHO. In an attempt to clarify the positions here, let us start with a shorter example: set S0, "zero" se

Re: [CVS ci] string_set is back for a faster live - not only

2002-11-06 Thread Leopold Toetsch
Dan Sugalski wrote: Substr should generate a new string and stick that into S0. If we want to build a fast version that reuses a string register, I'm fine with that--it's definitely useful in a large number of circumstances, large enough to warrant expressing both sets of semantics. Fine. Bu

Re: [CVS ci] string_set is back for a faster live - not only

2002-11-06 Thread Dan Sugalski
At 2:13 PM +0100 11/6/02, Leopold Toetsch wrote: Peter Gibbs wrote: Leopold Toetsch wrote: string_set is currently only used in string_substr, but, when people are ok with this, can be used everywhere in core.ops, where a string register is globbered. The behaviour of the following program

Re: [CVS ci] string_set is back for a faster live - not only

2002-11-06 Thread Leopold Toetsch
Peter Gibbs wrote: Leopold Toetsch wrote: string_set is currently only used in string_substr, but, when people are ok with this, can be used everywhere in core.ops, where a string register is globbered. The behaviour of the following program has changed, is this correct? set S0, "test"

Re: [CVS ci] string_set is back for a faster live - not only

2002-11-06 Thread Peter Gibbs
Leopold Toetsch wrote: > string_set is currently only used in string_substr, but, when people are > ok with this, can be used everywhere in core.ops, where a string > register is globbered. The behaviour of the following program has changed, is this correct? set S0, "test" set S1, S0 set

Re: [CVS ci] string_set is back for a faster live - not only

2002-11-06 Thread Leopold Toetsch
Leopold Toetsch wrote: [ substr in life.pasm ] ~10^6 times. 10^7 set S0, S1 { $1 = $2 } would become string_set(interpreter, $1, $2) Exactly this example is wrong, because here these 2 registers just point to the same string. leo

[CVS ci] string_set is back for a faster live - not only

2002-11-06 Thread Leopold Toetsch
As suggested by Brent, string_set gives us a big improvement, where strings are heavily used. One examples is life.pasm, where the generate loop does: substr S0, S15, I3, 1 ~10^6 times. Till now, S0 (the result of substr) was constructed every time, now it get's just reused. This improves lif