date-value parameters

Q&A's, tips, howto's
Locked
ralph.ronnquist
Posts: 228
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

date-value parameters

Post by ralph.ronnquist »

Somewhere something changed for date-value, which now doesn't evaluate its parameters, but requires explicit ints. E.g.

Code: Select all

(date-value 2015 1 1) ; is fine, but
(date-value (int "2015") 1 1) ; is not, and
(date-value '2015 1 1) ; is also not accepted
This changed for 10.6.3 sometime after May this year, but I didn't realize this until I quite recently upgraded a machine to the "final" 10.6.3 ...

Hopefully it is just a bug, or otherwise it certainly is something to make a clear note about in the documentation.

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: date-value parameters

Post by rickyboy »

I just confirmed this for pre-10.6.3.

Code: Select all

$ newlisp -C
newLISP v.10.6.2 32-bit on Win32 IPv4/6 libffi, options: newlisp -h

> (date-value 2015 1 1)
1420070400
> (date-value (int "2015") 1 1)
1420070400
> (date-value '2015 1 1)
1420070400
Good catch, Ralph!
(λx. x x) (λx. x x)

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: date-value parameters

Post by Lutz »

This was broken when introducing list-mode for parameters in development 10.6.3. Now fixed in: http://www.newlisp.org/downloads/develo ... nprogress/

ralph.ronnquist
Posts: 228
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: date-value parameters

Post by ralph.ronnquist »

Great. I'll get things upgraded eventually. Meanwhile I'll use the workaround of

Code: Select all

(apply date-value (list (int "2015") 1 1))

Locked