Hello,

Even if you are introducing a new syntax, your approach is wrong to
get intersection and interval, I was not talkative
but the samples I gave you expose several cases

// This isn't bad, but it's not really what i want, and... what I wrote! ;-)

so I guess you don't even understand what your are doing ? playing
with range, you may read the documentation about those objects into
the Apple Foundation those are following the same model, dealing with
list of ranges.

anyway what you exposed was really unclear, try to be more didactic,
we don't have crystal balls, and somehow Ijust trolled you like you
did, so please we are people we need a context.

Best,

On Fri, Nov 20, 2009 at 2:22 PM, Samuel ROZE <samuel.r...@gmail.com> wrote:
> Hi,
>
> This isn't bad, but it's not really what i want, and... what I wrote! ;-)
>
> Samuel.
>
> 2009/11/20 mm w <0xcafef...@gmail.com>:
>> http://code.google.com/p/foundation-kit/source/browse/trunk/FKRange.php
>> http://code.google.com/p/foundation-kit/source/browse/trunk/FKIndexSet.php
>>
>> On Fri, Nov 20, 2009 at 1:56 PM, Samuel ROZE <samuel.r...@gmail.com> wrote:
>>> Hello,
>>>
>>> I'm working on two classes, Interval and IntervalList which describe
>>> an interval and a list of intervals. These intervals are defined using
>>> the Interval class:
>>>
>>> <?php
>>> $interval = new Interval((int) $from, (int) $to);
>>> ?>
>>>
>>> These intervals can be stored in a list of intervals, using IntervalList:
>>>
>>> <?php
>>> $list = new IntervalList();
>>> $list->add($interval_1);
>>> $list->add($interval_2);
>>> ?>
>>>
>>> IntervalList's functions are:
>>> - inverse(); which returns an IntervalList object
>>> - intersection(); which returns an IntervalList object of intervals
>>> which are contained by every interval of this list.
>>>
>>> To be easier, what do you think about:
>>> <?php
>>> // An interval with [ & ]
>>> $interval = [ (int) $from, (int) $to ];
>>> ?>
>>>
>>> <?php
>>> // A list of intervals
>>> $list = [ $from_1, $to_1] + [$from_2, $to_2] + ... [$from_n, $to_n];
>>> $list_2 = [$from_1, $to_1] + ... + $interval_n;
>>> ?>
>>>
>>> Regards,
>>> Samuel ROZE.
>>>
>>> --
>>> PHP Internals - PHP Runtime Development Mailing List
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to