Search the web
Sign In
New User? Sign Up
frontierkernel · Frontier Kernel
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
my recent checkins: string.patternMatch, timing, and math verbs   Message List  
Reply | Forward Message #823 of 3834 |
There have been a lot of checkins this week (at least, compared to the
two previous weeks). Allow me to explain those changes that I'm
responsible for. (I also explain what changes you'll need to make to
the glue scripts, if you build Frontier or Radio from source.)

My checkins addressed four areas:

* string.patternMatch()
* clock.milliseconds()
* the script profiler
* math verbs

string.patternMatch now takes an optional third parameter, ix, to tell
Frontier where to start searching. This makes it possible to use
string.patternMatch to "walk" all the way through a string. (Just keep
setting the starting point to one more than the last match.)

Update your glue script at string.patternMatch so that the first line
says, "on patternMatch (pattern, s, ix = 1)".

clock.milliseconds() returns a timer value in thousandths of a second.
clock.ticks() was plenty fast enough back in the day, but these days
Frontier can do a few hundre operations in a single tick, so any
timing based on a tick is quite inaccurate.

Frankly, milliseconds isn't good enough either. Even on my decrepit
old G4/450, many verbs and operators run in less than a millisecond.
Andre and I both want microseconds (millionths), and in fact the
native timers this is based on all use microseconds, but for now this
is what we have.

The script profiler now uses milliseconds internally, instead of
ticks. By default, it converts the results to ticks just before
returning the profile results table, but you can request milliseconds
when you call script.stopProfile by passing an optional second
argument, flUseMilliseconds, like this:

script.startProfile( true )
... run some script here, to be profiled ...
script.stopProfile( adrResults, true )

You'll need to update the glue script at script.stopProfile. The first
line should now say: "on stopProfile (adrTable, flUseMilliseconds =
false)"

Finally, there's the new math group. There are currently only three
verbs, but more are planned (I'd like to see a math group similar to
Math in other languages like JavaScript, Java, c, etc.).

math.min (a, b)
- returns the lesser of two values
- more than a math verb, can compare anything
that can be compared with a less than symbol,
including strings
- usage:
math.min( 5, 7 )
>> 5
- replacement for this:
if ( a < b )
return a
else
return b

math.max (a, b)
- returns the greater of two values
- more than a math verb, can compare anything
that can be compared with a greather than symbol,
including strings
- usage:
math.max( 5, 7 )
>> 7
- replacement for this:
if ( a > b )
return a
else
return b

math.sqrt (n)
- returns the square root of n
- result is always a double

The glue scripts for the math verbs are attached to this email. I'll
also upload them to the files section on Yahoo.

Seth


Sat Jan 15, 2005 5:21 pm

macrobyteres...
Online Now Online Now
Send Email Send Email

Attachment
builtins.math.fttb
Type:
application/octet-stream
Forward
Message #823 of 3834 |
Expand Messages Author Sort by Date

There have been a lot of checkins this week (at least, compared to the two previous weeks). Allow me to explain those changes that I'm responsible for. (I also...
Seth Dillingham
macrobyteres...
Online Now Send Email
Jan 15, 2005
5:21 pm

... Thank you, Seth. Let me add that these changes have been checked into the experimental branch (trunk) only, i.e. they won't make it into the stable release...
Andre Radke
andre_radke
Offline Send Email
Jan 15, 2005
6:46 pm

Forgive my intrusion as a non-C_progammer but I am very curious to know if it a priority in your minds to add ATSUI to my very tired old friend Frontier. To...
John Delacour
valchiusella
Offline Send Email
Jan 15, 2005
7:11 pm

... I agree with you, it is very important. Of course, Unicode support is more than just ATSUI <http://developer.apple.com/intl/atsui.html>, because Frontier...
Seth Dillingham
macrobyteres...
Online Now Send Email
Jan 15, 2005
7:46 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help