Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46138 Return-Path: <0xcafefeed@gmail.com> Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83491 invoked from network); 20 Nov 2009 22:36:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Nov 2009 22:36:12 -0000 Authentication-Results: pb1.pair.com header.from=0xcafefeed@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=0xcafefeed@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.213 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: 0xcafefeed@gmail.com X-Host-Fingerprint: 209.85.218.213 mail-bw0-f213.google.com Received: from [209.85.218.213] ([209.85.218.213:45401] helo=mail-bw0-f213.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/D4-25743-AD9170B4 for ; Fri, 20 Nov 2009 17:36:11 -0500 Received: by bwz5 with SMTP id 5so3973261bwz.23 for ; Fri, 20 Nov 2009 14:36:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Bwjhrp2SlI2JaIRlHOdeqYX5QzH3V6T3Fhe+5jfW++0=; b=T0q3orvKWUHSLVxhABrRAUcLRAhHUyAMBoOx3AAbv9g6IWNLfFXobfP8BJy9MNDFNr 3SCCzlpecnOcrHLkvoK0BVHyk3IptuVIbNf49CrjutmAMdsV//v+5e3i46xkvExKOFLR HCIzXUOkv6qXsvgoBlmpmHba6zyS4K8cY22TE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=iP1mDjAhmDsLfyPCKuNhMx+KpUvG4i4ciAZbmexbnOzLproQ4LXhaV6r52bmp07KEF WgOQhMAOEOedl+yaJXgcjjXjgRY06oNMHqJ1t+1Jqo5gnAlT/V3dU+QLRL+53YOLtipu 635PcmdDtt3UvuMtwFssC2Ahhu98PB9m3cF8A= MIME-Version: 1.0 Received: by 10.204.15.16 with SMTP id i16mr1944360bka.72.1258756567560; Fri, 20 Nov 2009 14:36:07 -0800 (PST) In-Reply-To: <18e9608a0911201422p2e8b16cdra194f09c1965c578@mail.gmail.com> References: <18e9608a0911201356g4d3ca1ffsef1499c7ada929f6@mail.gmail.com> <18e9608a0911201422p2e8b16cdra194f09c1965c578@mail.gmail.com> Date: Fri, 20 Nov 2009 14:36:07 -0800 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Intervals representation with brackets From: 0xcafefeed@gmail.com (mm w) 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 wrote: > 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.php >> >> On Fri, Nov 20, 2009 at 1:56 PM, 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: >>> >>> >> $interval = new Interval((int) $from, (int) $to); >>> ?> >>> >>> These intervals can be stored in a list of intervals, using IntervalList: >>> >>> >> $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: >>> >> // An interval with [ & ] >>> $interval = [ (int) $from, (int) $to ]; >>> ?> >>> >>> >> // 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 >> >> >