Handling of final delimter (was Re: "this me"?)

Mike Kerner MikeKerner at roadrunner.com
Mon Aug 12 15:47:26 EDT 2013


Geoff,
I haven't messed with it, but does "last char" have the same performance as
"char -1"?


On Mon, Aug 12, 2013 at 3:32 PM, Geoff Canyon <gcanyon at gmail.com> wrote:

> Another way:
>
>       if char -1 of tList is the itemdelimiter then delete char -1 of tList
>
> For short lists, item 1 to -1 is faster. For long lists the above gets to
> be perhaps 5x faster.
>
>
> On Mon, Aug 12, 2013 at 12:30 PM, Devin Asay <devin_asay at byu.edu> wrote:
>
> >
> > On Aug 12, 2013, at 10:51 AM, Mark Wieder wrote:
> >
> > > Terry-
> > >
> > > Sunday, August 11, 2013, 11:04:26 PM, Terry Judd wrote:
> > >
> > >> Agreed - for practical purposes it's only 3 - although I still
> > >> can't get out of the habit of deleting the trailing delimiter from a
> > >> constructed list before processing it in a repeat loop.
> > >
> > > I do too. And for that reason, neither of us would have code that
> > > would be affected by changing the way items and lines are counted. But
> > > there *is* other legacy code out there that does rely on the current
> > > behavior.
> >
> >
> > You know how I get rid of trailing delimiters?
> >
> >   put line 1 to -1 of tList into tList
> >
> >   put item 1 to -1 of tItems into tItems
> >
> > Kills that dang dangling delimiter dead.
> >
> > Devin
> >
> >
> > Devin Asay
> > Office of Digital Humanities
> > Brigham Young University
> >
> >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



More information about the use-livecode mailing list