Search the web
Sign In
New User? Sign Up
frink
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

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
How do you spell "interval?"   Message List  
Reply | Forward Message #41 of 257 |
Re: [Frink] How do you spell "interval?"

(i'm about to launch into an unfounded ramble through ideas, which may
not go anywhere useful. feel free to skip to that much more
interesting email from your significant other)

Intervals do indeed sound cool. Tell me, is there any reason the same
funkiness couldn't be applied to arrays?

array1 = [3, 5, 7, 11, 13, 17, 23]
array2 = 4 array1

Alternatively, have you thought of pinching perl 6's hyper ops?

array2 = 4 * ^array1

In fact, when you start to introduce values which are vectors,
matrices, complex numbers and so on, you suddenly have a huge variety
of not-so-real numbers, any pair of which could be fed into any of the
standard mathematical operators and expected to "just work". Maybe i'm
being a little unfair - such a thing would be a bitch and a half to
implement, whatever the syntax.

(i can't actually remember much real frink syntax, nor have i followed
perl 6 in about six months, meaning it's probably all wrong. forgive
me)

I don't like the idea of i[3, 5], any more than new Interval[3, 5].
They both seem somehow ugly, and not just because it interferes with
normal multiplication by i. The options that seem more pleasing to my
eye are the ones like [3 something 5], only with a smaller and more
visible character clump in between. Tell, what would frink currently
make of the following?

[3 .. 5]
[3 . 5]
[3 ~ 5]
[3 -- 5]
[3 _ 5]

My intuition (she is a harsh mistress) says that they should mean:

[3 .. 5] => the array [3, 4, 5]
[3 . 5] => something to do with 5 being a member of the 3 object
(which make her very unhappy)
[3 ~ 5] => she thinks ~ looks like some existing mathematical
operator, but doesn't know what, but it expects that to mean the
one-element array containing the result of that calculation
[3 -- 5] => a comment after the 3
[3 _ 5] => she doesn't quite know. good candidate?

It also needs to be something that allows the inclusion of a middle
value. Something like this:

[3 _ 4 _ 5]

Does that work for you?

Thinking about it, the array brackets are starting to look slightly
superfluous - and more to the point, they're encouraging me to think
of things like:

[3 _ 5, 4 _ 6]

So my brain clearly thinks that these are perfectly valid ways to do intervals:

x = 3 _ 5
y = 3 _ 4 _ 5

But it's probably wrong. Is there a good reason you want to use array
brackets, not group brackets? This actually seems like a perfect
instance where what you're defining is a grouped calculation,
producing one value rather than a list:

x = (3 _ 5)
y = (3 _ 4 _ 5)

Returning to my thought earlier, it seems like group brackets might
have other uses:

complex = (3 + 4i)
interval = (3 _ 5)
interval2 = (3 _ 4 _ 5)
vector = (3, 4)
matrix = (3, 4; 5, 6)

or somesuch. all of which may be pretty, but will very quickly become
ambiguous. The slightly ugly thought occurs to me of using a keyword
inside the brackets like this:

complex = (3 + 4i) // this really is just calculated, not constructed
interval = (interval 3, 5)
interval2 = (interval 3, 4, 5)
vector = (vector 3, 4)
matrix = (matrix 3, 4; 5, 6)

But i'm sure you'll reject that as being a corruption of the currently
nice and pure group brackets.

Anyway. That lot wasn't really an answer. Do i win? Or do i just need
to go get some sleep?



Sun May 22, 2005 11:18 pm

shrink_laureate
Offline Offline
Send Email Send Email

Forward
Message #41 of 257 |
Expand Messages Author Sort by Date

I'm working on implementing interval arithmetic in Frink. Interval arithmetic is cool--instead of a number being a single value, an interval can contain a...
Alan Eliasen
aeliasen
Offline Send Email
May 22, 2005
2:26 am

(i'm about to launch into an unfounded ramble through ideas, which may not go anywhere useful. feel free to skip to that much more interesting email from your...
Marcus Downing
shrink_laureate
Offline Send Email
May 22, 2005
11:18 pm

... To paraphrase Kirk's comment about Spock, "your unfounded ramble is as good as another man's well-considered reply." ... Actually, multiplying a scalar by...
Alan Eliasen
aeliasen
Offline Send Email
May 23, 2005
2:59 am

... Ah, i didn't grok what intervals really were. I was thinking of them only in terms of their outer bounds, and simple calculations like + 2. Realizing that...
Marcus Downing
shrink_laureate
Offline Send Email
May 23, 2005
3:33 pm

... What about A .. B? Examples: for i = 0 .. 100 ; do fa[i] = f[i] + f[i-1]; done lunchtime = 12am .. 1pm if x in lunchtime; then do_lunchtime_event ; endif ...
Alan K. Stebbens
alan_stebbens
Online Now Send Email
May 23, 2005
6:34 am

... Marcus Downing also suggested this (and a few similar options) and I addressed it in my last reply. I understand if you didn't plow through that whole...
Alan Eliasen
aeliasen
Offline Send Email
May 23, 2005
5:13 pm

... Hmm... well I'd definitely go with an object interface, just in case you wanted to add probabilities to the intervals next, or maybe define intervals in...
Edward Peschko
esp5@...
Send Email
May 23, 2005
7:58 pm

Wow. A fuzzy calculator. That really would be impressive. ... I did actually wonder about using a syntax like this, if no symbolic one presented itself. I...
Marcus Downing
shrink_laureate
Offline Send Email
May 23, 2005
10:51 pm

... That would be neat, but hard! Actually, maybe not that hard. If I understand the intent correctly, you could do something very similar by defining a few...
Alan Eliasen
aeliasen
Offline Send Email
May 24, 2005
6:59 am
Advanced

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