{"id":885,"date":"2009-09-11T09:45:00","date_gmt":"2009-09-11T08:45:00","guid":{"rendered":"http:\/\/it4bus.vn\/itersdesktop\/2009\/09\/11\/some-notes-working-with-common-lisp\/"},"modified":"2009-09-11T09:45:00","modified_gmt":"2009-09-11T08:45:00","slug":"some-notes-working-with-common-lisp","status":"publish","type":"post","link":"https:\/\/www.itersdesktop.com\/vi\/2009\/09\/11\/some-notes-working-with-common-lisp\/","title":{"rendered":"Some notes working with Common Lisp"},"content":{"rendered":"<p>1. When using multiple-value-bind, there are some values that we don&#8217;t need. We can ignore the warning &#8220;The variable x, y,&#8230; is never used&#8230;&#8221;. Below is an example:<br \/>(defun my-round (x)<br \/>  (round (+ x 0.5)))<\/p>\n<p>(defun next-power-of-two (x)<br \/>  (let ((log-base2 (\/ (log x) (log 2))))<br \/>    (multiple-value-bind (y z)<br \/>        (my-round (expt 2 (ceiling log-base2)))<br \/>      (declare (ignorable z))<br \/>      y)))<br \/>Because the my-round functions returns two values, but I only use the first one. When I apply this function inside the next-power-of-two function, I also need the first.<\/p>\n<p>2. In order to use the hexadecimal values in Common Lisp, we can use &#8220;#x&#8221; or &#8220;x16r&#8221; to represent them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. When using multiple-value-bind, there are some values that we don&#8217;t need. We can ignore the warning &#8220;The variable x, y,&#8230; is never used&#8230;&#8221;. Below is an example:(defun my-round (x)&hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-885","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/posts\/885","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/comments?post=885"}],"version-history":[{"count":0,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/posts\/885\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/media?parent=885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/categories?post=885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/tags?post=885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}