Re: LWM newbie questions
On May 7, 2005, at 2:37 PM, Laughing Water wrote:
> Question 1
> I'd like to use text-to-speech in my time clock program (Mac). I
> haven't found a command that's part of LWM to do it. Would it take
> using the FLI?
>
> In MCL this would be:
>
> ;; Speak a string (Str255)
> (defun say (it)
> (with-pstrs ((thestring it)) (#_speakstring thestring)))
Yes, LispWorks does not come with all Carbon entry points already
parsed and ready to use like MCL. So you would use the FLI to define a
foreign function for speakstring.
LispWorks has an Objective C API which is often easier to use than
defining FLI functions. Looking at the NSSpeechSynthesizer class, I
think it would only take a few lines of code to speak a string.
>
>
> Question 2
> MCL provides a choose-file-dialog command for opening a user-selected
> file which can then be used with with-open-file. How would you get
> that functionality in LWM? (I seem to be drowning in streams looking
> for this.)
You want capi:prompt-for-file.
>
> Question 3
> MCL has had a great reputation as a Mac development tool, in part
> because it provides high-level commands that remove the need to use
> Mac toolbox calls, but also because it provides access to toolbox
> calls. I like how LWM provides for interface development, but what
> about access to QuickTime, AppleEvents and other Mac technologies?
None of the technologies you mention are ready to go out of the box,
but anything is doable with the FLI and/or the Objective C interface.
>
> Comment
> I'm hoping to do some pretty ambitious (primarily database-related)
> projects with Lisp, and I'm willing to pay the price (maybe even the
> Enterprise edition), but I need to know whether LWM is the right tool.
> I like the Lisp way of doing things (there's the seductive idea that
> it's the best language for producing a language that fits the problem,
> that it allows one to develop the development tools). I might use MCL
> (for which I currently have a license) if I can get past some problems
> with it (like a list-panel that provides no immediate visual feedback,
> plus the fact of it having such a small developer community and no
> evident agenda). On the other hand, I'll use REALbasic or Cocoa if I
> have to, because they're up-to-date regarding Mac technologies, have
> excellent interface design tools and are database-friendly.
>
> I'd love some guidance from those of you with more experience.
You have a lot of options for doing database work. In addition to the
Enterprise Edition, the CL-SQL project provides databases interfaces
for just about anything. All the tools are there for building nice
interfaces, but I don't think you'll find it to be anywhere near as
easy as REALBasic. But I really like the constraint based interface
model rather than pushing things around to specific pixel positions
(you can still do this if you want).
My big wish list item for database work would be for the
multi-column-list-pane to support lazy evaluation. Right now if you
have 100,000 rows, they are all "processed" even though the underlying
Cocoa object has ability to use a data source that only worries about
what is visible in the view (and LispWorks already has the right Lisp
API to support it). But I have played around with Objective C interface
enough convince myself I can attach a proper data source to the list
view to make this work if I really need to have it.
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL