Page 1 of 1

date-value parameters

Posted: Wed Aug 05, 2015 1:34 pm
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.

Re: date-value parameters

Posted: Wed Aug 05, 2015 2:48 pm
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!

Re: date-value parameters

Posted: Wed Aug 05, 2015 9:21 pm
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/

Re: date-value parameters

Posted: Wed Aug 05, 2015 10:07 pm
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))