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
// 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;
?>
This made no sense to me.
Are you suggesting new object operator? Short-syntax-array?
What exactly are you asking/informing/reporting/whatever?
-Hannes
Are you suggesting new object operator? Short-syntax-array?
Short-syntax-interval ! :-)
What exactly are you asking/informing/reporting/whatever?
I'm just asking if, for you, brackets can represent intervals...
http://code.google.com/p/foundation-kit/source/browse/trunk/FKRange.php
http://code.google.com/p/foundation-kit/source/browse/trunk/FKIndexSet.php
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.
Hi,
This isn't bad, but it's not really what i want, and... what I wrote! ;-)
Samuel.
2009/11/20 mm w 0xcafefeed@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.phpHello,
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.
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,
Hi,
This isn't bad, but it's not really what i want, and... what I wrote! ;-)
Samuel.
2009/11/20 mm w 0xcafefeed@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.phpHello,
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.
Samuel ROZE 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;
?>
No chance that top-level square brackets will mean intervals, sorry.
-Rasmus
It's clear. ;-)
Thanks.
2009/11/20 Rasmus Lerdorf rasmus@lerdorf.com:
Samuel ROZE 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;
?>No chance that top-level square brackets will mean intervals, sorry.
-Rasmus