From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2216 invoked by alias); 10 Aug 2011 15:39:00 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29667 Received: (qmail 26636 invoked from network); 10 Aug 2011 15:38:58 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.220.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=V38Li51HuBq6tPUfAcdZ4ov0tvdyLMTw5p3qoGkTMKg=; b=XiC4fk8gIlb5jvWJOg1X0X1+Dc17Jjd1uUblEM5nwhvyrCIbEZNWu1fhunUTHOZE/X SBonw+E58Vw3K4hOkFosZJm2gz/7XvoMqp3yQIz5t80UhjGrMuk+0QMwuym0iVO/HH1w fln49xVdaWDLhPlr89vcfkWh8+99iUY5nGN/Y= MIME-Version: 1.0 In-Reply-To: <110810083017.ZM4722@torch.brasslantern.com> References: <20110810122137.3a3e4c00@pwslap01u.europe.root.pri> <20110810124120.0479177b@pwslap01u.europe.root.pri> <110810083017.ZM4722@torch.brasslantern.com> Date: Wed, 10 Aug 2011 17:38:52 +0200 Message-ID: Subject: Re: PATCH: zsh/datetime $EPOCHREALTIME From: Mikael Magnusson To: "Zsh Hackers' List" Content-Type: text/plain; charset=UTF-8 On 10 August 2011 17:30, Bart Schaefer wrote: > On Aug 10, 12:41pm, Peter Stephenson wrote: > } > } I'm actually wondering if we ought to be a bit smarter and add an > } epochrealtime array with the seconds and nanoseconds as elements > } (guaranteed to be consistent, obviously). Exercise for the reader. > > Better (?) still: > > Allow the user to apply typeset to EPOCHSECONDS. If it's an int, > it is as it is now. If it's a float, what you called EPOCHREALTIME. > If an array, elements for seconds and nanoseconds. If a hash, the > keys are tv_sec and tv_nsec like a timespec (convert from tv_usec > when using gettimeofday). > > Too bad that would require mucking about with whether it's special > and readonly, or else introducing provision for other special cases > into typeset ... If it's an array, how do you get both elements at the 'same' time? I'm guessing you would always have to copy the array in one step and then access the elements in the copy. -- Mikael Magnusson