Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46137 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76281 invoked from network); 20 Nov 2009 22:22:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Nov 2009 22:22:42 -0000 Authentication-Results: pb1.pair.com header.from=samuel.roze@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=samuel.roze@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.226 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: samuel.roze@gmail.com X-Host-Fingerprint: 209.85.219.226 mail-ew0-f226.google.com Received: from [209.85.219.226] ([209.85.219.226:45948] helo=mail-ew0-f226.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2A/63-25743-EA6170B4 for ; Fri, 20 Nov 2009 17:22:40 -0500 Received: by ewy26 with SMTP id 26so217137ewy.23 for ; Fri, 20 Nov 2009 14:22:34 -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:cc:content-type; bh=OkfHD3b4wCRXgEYRAXhZXrnPZL4mR50EXlYA3NFPHjU=; b=TIV/RN3a3WZLb7pDaC8InUH6TErUc3Rq+0cEED80hxRG78+8L5BnMnhTthXNpoc2Do oaiyR7Aui1z5kyp5pdlV081vPBHmtoq4+vsL9iLBey+E78xC9WHdhOB9FAsbyilU73M0 txBxELjbxMbuyiC/kO3MirdEPPngpGo04a1Uc= 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 :cc:content-type; b=IzzxwlrzlmlcRz9JRq6hMXFgTSk7LNcpIHXEpaf1RnETxKBGhiimDOFNs7jD4NJvSj O6lI20BN7HD5TUd8+yVKyxmCWK4M7VUaFHXDsLZ5HQO/BC+76pTS3fzud+k7+gjjDb5S VvH2yE3PQRHzJeQYUSTPFYhCeP5tzjQgq0alk= MIME-Version: 1.0 Received: by 10.216.91.67 with SMTP id g45mr607560wef.190.1258755754366; Fri, 20 Nov 2009 14:22:34 -0800 (PST) In-Reply-To: References: <18e9608a0911201356g4d3ca1ffsef1499c7ada929f6@mail.gmail.com> Date: Fri, 20 Nov 2009 23:22:34 +0100 Message-ID: <18e9608a0911201422p2e8b16cdra194f09c1965c578@mail.gmail.com> To: mm w <0xcafefeed@gmail.com> Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Intervals representation with brackets From: samuel.roze@gmail.com (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.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 > >