date-value parameters

Q&A's, tips, howto's

date-value parameters

Postby ralph.ronnquist » Wed Aug 05, 2015 1:34 pm

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.
ralph.ronnquist
 
Posts: 208
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: date-value parameters

Postby rickyboy » Wed Aug 05, 2015 2:48 pm

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)
rickyboy
 
Posts: 594
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: date-value parameters

Postby Lutz » Wed Aug 05, 2015 9:21 pm

This was broken when introducing list-mode for parameters in development 10.6.3. Now fixed in: http://www.newlisp.org/downloads/develo ... nprogress/
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: date-value parameters

Postby ralph.ronnquist » Wed Aug 05, 2015 10:07 pm

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))
ralph.ronnquist
 
Posts: 208
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 2 guests

cron