newLISP Fan Club

Forum => Whither newLISP? => Topic started by: TedWalther on April 19, 2015, 01:47:20 PM

Title: Feature request: add call pattern to (date-value)
Post by: TedWalther on April 19, 2015, 01:47:20 PM
It is true, I can do (apply date-value (now))

However, I have been working with Julian days for a while, and just generally doing date and time related stuff, and so I request that you add the call pattern:



(date-value list)

Ex:
(date-value (now))


This is parallel to how arguments are dealt with in that format function, so it makes sense from a "principle of least surprise" perspective.
Title: Re: Feature request: add call pattern to (date-value)
Post by: Lutz on April 19, 2015, 11:51:12 PM
Makes sense, added here:

http://www.newlisp.org/downloads/development/inprogress/


> (date-value (date-list (date-value (date-list (date-value (now))))):-)
1429520236
>

http://www.newlisp.org/downloads/development/inprogress/newlisp_manual.html#date-value
Title: Re: Feature request: add call pattern to (date-value)
Post by: TedWalther on April 20, 2015, 10:31:23 PM
Thank you Lutz!  And, I tremble to ask it.  It is so easy to get the current date with (date-list (date-value))

But, for sake of consistency, would it slow anything down to let (date-list) do the same thing as (date-value) and (date)?  That is, give the current time in the appropriate format?
Title: Re: Feature request: add call pattern to (date-value)
Post by: Lutz on April 21, 2015, 02:50:36 AM
... now it fits all together :)


> (date-value) (date-value (date-list))
1429600114
1429600114
> (date-list) (date-list (date-value))
(2015 4 21 7 8 51 111 2)
(2015 4 21 7 8 51 111 2)
>


http://www.newlisp.org/downloads/development/inprogress/
Title: Re: Feature request: add call pattern to (date-value)
Post by: TedWalther on April 21, 2015, 10:07:33 AM
Woohoo!  One of newLisps great strengths is its consistency of interface.