Discussion of Common Lisp
-
Stiv
- Posts: 11
- Joined: Wed Sep 29, 2010 6:52 am
Post
by Stiv » Tue Dec 28, 2010 2:51 am
Hi all,
Sorry but I can't get current month

.
How can I do it?
Thanks,
bye
-
Duke
- Posts: 38
- Joined: Sat Oct 17, 2009 10:40 pm
-
Contact:
Post
by Duke » Tue Dec 28, 2010 3:30 am
Stiv wrote:Hi all,
Sorry but I can't get current month

.
How can I do it?
Thanks,
bye
I'm thinking you're going to want at least two of these functions:
Code: Select all
multiple-value-bind
decode-universal-time
get-universal-time
Look them up if you don't know what they are.
"If you want to improve, be content to be thought foolish and stupid." -Epictetus
-
Stiv
- Posts: 11
- Joined: Wed Sep 29, 2010 6:52 am
Post
by Stiv » Tue Dec 28, 2010 5:24 am
Thanks very much,
I've done so:
Code: Select all
(multiple-value-bind (s min b gg m a b2 b3 b4)
(decode-universal-time (get-universal-time))
(list m))
but it generates many style-warning, how can I improve it?
Thanks,
Bye
-
gugamilare
- Posts: 406
- Joined: Sat Mar 07, 2009 6:17 pm
- Location: Brazil
-
Contact:
Post
by gugamilare » Tue Dec 28, 2010 7:02 am
Try this:
Code: Select all
(multiple-value-bind (s min b gg m a b2 b3 b4)
(decode-universal-time (get-universal-time))
(declare (ignore s min b gg a b2 b3 b4))
(list m))
-
Stiv
- Posts: 11
- Joined: Wed Sep 29, 2010 6:52 am
Post
by Stiv » Tue Dec 28, 2010 7:45 am
Thanks, it works.
-
nuntius
- Posts: 538
- Joined: Sat Aug 09, 2008 10:44 am
- Location: Newton, MA
Post
by nuntius » Tue Dec 28, 2010 7:00 pm
A 1-liner:
Code: Select all
(fifth (multiple-value-list (decode-universal-time (get-universal-time))))
-
Stiv
- Posts: 11
- Joined: Wed Sep 29, 2010 6:52 am
Post
by Stiv » Wed Dec 29, 2010 3:38 am
Thanks very much
