2009/4/8 James Paige <b...@hamsterrepublic.com>: > On Wed, Apr 08, 2009 at 04:04:33AM +1200, Ralph Versteegen wrote: >> 2009/4/8 James Paige <b...@hamsterrepublic.com>: >> > On Wed, Apr 08, 2009 at 02:06:37AM +1200, Ralph Versteegen wrote: >> >> 2009/4/7 James Paige <b...@hamsterrepublic.com>: >> >> > Here is what I would like to do regarding enabling TextSlices via >> >> > plotscripting. >> >> > >> >> > Implement text slice commands: >> >> > >> >> > create text slice >> >> > set text(sl, string ID) >> >> > >> >> > "set text" would be the only command I would implement right now for >> >> > working with the actual text of a TextSlice. All it would do is copy the >> >> > string from a given string ID into a slice. That would be enough so that >> >> > text could be anchored, layered, and wrapped within a box. The "set >> >> > text" command would be easy to upgrade to accept a real string once they >> >> > are implemented. >> >> > >> >> > This plan will be super easy, and I don't see it as adding to the >> >> > existing backcompat burden regarding strings. >> >> > >> >> > Thoughts? >> >> > >> >> > --- >> >> > James >> >> >> >> OK, I give in. >> >> >> >> But I'm just wondering: what should we do about timers? >> >> >> >> Our current plotstrings won't be totally obsolete due to ${S#} tags, >> >> but maybe we can make everyone forget (eventually) about the graphical >> >> fixed-id string commands. We can have an 'obsolete commands' section >> >> in the dictionary. >> > >> > Yeah, I think we have a couple commands that could go there already >> > (like the misspelled "suspend catapillar party") >> >> But I can never remember which is the right spelling! > > My solution is to get in the habit of saying "cat-ur-pile-ar" whenever I > say it out loud. I sound like a goof, but at least I always spell it > right :)
That still doesn't help, because I pronounce it as cat-a-pill-a! >> > ${S#} is worth thinking about though. Once we have real strings, how >> > will we embed a string into a textbox without requiring the script to >> > copy the string into an old string ID? >> >> I think ID numbers are a very reasonable way to embed things in >> textboxes. Actually... once you can store strings in global variables, >> you'll be able to use ${G#} as a replacement for ${S#}, assuming that >> ${G#} prints an accurate representation of a variable. > > Ah, of course! Once globals can hold strings this it would only make > sense for ${G#} to be able to display strings > > I wonder if, after the SAV format has been redone, we can devise a way > to make it possible to reference globals by name rather than by ID > number, perhaps using a method similar to what is currently done with > new-style plotscripts? > >> A detail that might be relevant that was never decided (by me, if it >> was never asked of anyone else) was whether real string variables >> would be variables bound to string objects (like in Python, where two >> variables can be bound to the same Dict (mutable) or string >> (immutable)) or whether each variable (ignoring a pass-by-reference >> feature, which can be considered aliasing) will always point to a >> unique string (ignoring implementation details like copy-on-write) >> that can't be modified by any other variable. > > I prefer the python way. If I really explicitly know I need a copy of a > variable and not a reference, I would rather do something like > > v2 := copy(v1) > > But at least in my own python programming I find the situtations where > copying instead of referring is REALLY needed for a REAL reason and not > just for superstition are awfuly rare. > > --- > James No, wait, that's different from python, at least for strings, since strings are immutable in python. I feel nervous about making the following two situations act differently: a := 3 b := a a := 4 a := "3" b := a a := "4" On the other hand, our users are used to working with references to game objects, which are never copied, and maybe that's what we should look to? An alternative to a copy() operator could be a ref() operator. _______________________________________________ Ohrrpgce mailing list ohrrpgce@lists.motherhamster.org http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org