<html>
<head>
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>
<div style="font-family: Consolas, monospace; font-size: 12px; "><span class="Apple-style-span" style="font-size: 14px; font-family: Calibri, sans-serif; ">
<div>
<div>
<div>
<div><font class="Apple-style-span" face="Calibri,sans-serif">Hi Ron,</font></div>
<div><font class="Apple-style-span" face="Calibri,sans-serif"><br>
</font></div>
<div><font class="Apple-style-span" face="Calibri,sans-serif">Thanks. That code works well and shaves a good bit of awkwardness off the </font><span class="Apple-style-span" style="font-family: Calibri, sans-serif; ">workflow. I¹ve got one problem however:
loading the file containing the </span><span class="Apple-style-span" style="font-family: Calibri, sans-serif; ">code via quicklisp, e.g. (ql:quickload “foo") errors out in the reader </span><span class="Apple-style-span" style="font-family: Calibri, sans-serif; ">when
parsing that code. The problem appears to be related to (require “</span><span class="Apple-style-span" style="font-family: Calibri, sans-serif; ">cocoa") not being evaluated before the write-to-clipboard function is. It works </span><span class="Apple-style-span" style="font-family: Calibri, sans-serif; ">fine
in slime/emacs when evaluating things individually (perhaps it is a </span><span class="Apple-style-span" style="font-family: Calibri, sans-serif; ">timing issue?)</span></div>
<div><font class="Apple-style-span" face="Calibri,sans-serif"><br>
</font></div>
<div><font class="Apple-style-span" face="Calibri,sans-serif">Two questions:</font></div>
<div><font class="Apple-style-span" face="Calibri,sans-serif"><br>
</font></div>
<ol>
<li><font class="Apple-style-span" face="Calibri,sans-serif">What is best practice when using (require “cocoa") and a project to be </font><span class="Apple-style-span" style="font-family: Calibri, sans-serif; ">loaded from quicklisp?</span></li><li><font class="Apple-style-span" face="Calibri,sans-serif">Do I need to bring in all the Objective-C bridge just to use the </font><span class="Apple-style-span" style="font-family: Calibri, sans-serif; ">clipboard? I.e. Is there a lighter-weight way to access
pasteboard?</span></li></ol>
<div><font class="Apple-style-span" face="Calibri,sans-serif"><br>
</font></div>
<div><font class="Apple-style-span" face="Calibri,sans-serif">Happy Christmas,</font></div>
<div><font class="Apple-style-span" face="Calibri,sans-serif"><span class="Apple-tab-span" style="white-space: pre; "></span><span class="Apple-tab-span" style="white-space:pre"></span>- Steve</font></div>
<div><font class="Apple-style-span" face="Calibri,sans-serif"><br>
</font></div>
<div><font class="Apple-style-span" face="Calibri,sans-serif">P.S. Moderators: please forgive me if you’ve seen this a few times in the moderation queue. I’m having some email problems.</font></div>
<div><font class="Apple-style-span" face="Calibri,sans-serif"><br>
</font></div>
</div>
</div>
</div>
<span id="OLK_SRC_BODY_SECTION" style="color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div style="font-family: Calibri; font-size: 11pt; text-align: left; color: black; border-bottom-width: medium; border-bottom-style: none; border-bottom-color: initial; border-left-width: medium; border-left-style: none; border-left-color: initial; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; border-top-style: solid; border-right-width: medium; border-right-style: none; border-right-color: initial; padding-top: 3pt; ">
<span style="font-weight: bold; ">From: </span>Ron Garret <<a href="mailto:ron@flownet.com">ron@flownet.com</a>><br>
<span style="font-weight: bold; ">Date: </span>Monday, 22 December 2014 11:22 <br>
<span style="font-weight: bold; ">To: </span>Steven Núñez <<a href="mailto:sales@illation.com">sales@illation.com</a>><br>
<span style="font-weight: bold; ">Cc: </span>"<a href="mailto:openmcl-devel@clozure.com">openmcl-devel@clozure.com</a>" <<a href="mailto:openmcl-devel@clozure.com">openmcl-devel@clozure.com</a>><br>
<span style="font-weight: bold; ">Subject: </span>Re: [Openmcl-devel] GraphSketcher Anyone? (or: can I write to the clipboard)<br>
</div>
<div><br>
</div>
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Turns out objc:make-nsstring is a built-in function now, so you can just do this:
<div><br>
</div>
<div>
<div>(defun write-to-clipboard (string)</div>
<div> (let ((pb (#/generalPasteboard ns:ns-pasteboard)))</div>
<div> (#/clearContents pb)</div>
<div> (objc:with-autorelease-pool</div>
<div> (#/writeObjects: pb (#/initWithObject:</div>
<div> (#/alloc ns:ns-array)</div>
<div> (objc:make-nsstring string))))))</div>
</div>
<div><br>
<div></div>
</div>
</div>
</div>
</span></span></div>
</div>
</body>
</html>