[Openmcl-devel] prompt-for-file (embarrassing question)

Craig Lanning craig.t.lanning at gmail.com
Wed Mar 29 23:25:51 PDT 2017


On Thu, 2017-03-30 at 04:32 +0000, Toomas Altosaar wrote:
> And I spent a good half hour just two days ago on Franz's Allegro
> Common Lisp trying to do exactly the same!
> 
> Why? So that I could see what a pathname looked like on ACL/Windows.
> I felt helpless and computer illiterate / humiliated.

The easiest way to see what a pathname looks like on a particular
platform is to do 

(make-pathname :directory '(:absolute "foo" "bar" "baz")
               :name "file" :type "ext" :version :newest
               :defaults *default-pathname-defaults*)

> [My Lisp path: 1987 (Symbolics) ==> 1994 (MCL) ==> present (ahem, ...
> still MCL)].

I also started on Symbolics (1985) and along the way have used Golden
Common Lisp, Allegro CL, LispWorks CL, C Lisp, SBCL, CLiCC, and Clozure
CL.

> While trying to get ACL to throw me up something that resembled MCL's
> choose-directory-dialog, I estimated that my productivity for that
> hour was about 100x slower than usual (which is slow to begin with).
> Very much out of my comfort zone.

There is no standardized way to get a pathname from the user in Common
Lisp.  That is a very GUI specific activity.  Each lisp vendor has its
own GUI framework.  Most of them also have CLIM available.  Some of
them (like LispWorks) discourage the use of CLIM and prefer that their
customers use their specific GUI toolkit (CAPI for LispWorks).

> My goal is to move to CCL one day but alas, my understanding
> (definitely incorrect and biased)  is that there is no comparative
> GUI/IDE and the learning curve is way too steep (and thus too
> expensive to even consider partaking in until MCL hardware breaks
> down).

If you are familiar with standard Common Lisp, then Clozure CL is no
different from any other Common Lisp.  I have a command line
application that I can easily compile in Symbolics CL, SBCL, and
Clozure CL with minimal #+/#- in the code.  This is not a trivail
program.  It is capable of reading complex data specification schema
files (ISO 10303-11) and the data that those files respresent (ISO
10303-21).

I generally do my editing in XEmacs and run the lisp in a shell (I use
Linux as my OS).

I am currently working on porting the CLIM (Common Lisp Interface
Manager) code that was release by Franz to work on Clozure CL. I, too,
want to move to Clozure CL as my primary development platform. Along
with porting the code, I am working on a document to help people use
CLIM to build applications.  This document represents the collection of
my experience in building CLIM applications.

I also need CLIM running so that I can build a CLIM based application.
Currently, I'm working on the application in LispWorks because it has
CLIM available.  My problem is that I only have LispWorks for Linux and
I need my application to run on Linux, Mac, and Windows.  CLIM on
Clozure CL will make that possible.

I think that CLIM should be considered the preferred GUI for Common
Lisp.  It is based on Dynamic Windows from Symbolics so it should be
possible to take CLIM and rebuild a lot of the Symboics interface
(specifically, the mouse sensitive output in the Lisp Listener).

My understanding is that Clozure CL does have a GUI on the Mac, but not
the other platforms.  Once CLIM is ported to Clozure CL it should be
possibe to reimplement that GUI in CLIM and make it available on all
Clozure CL platforms.  There will just need to be specialized backends
for each platform so that the applications that are built look
appropriate for the platform that they are running on.

Craig

> > 
> > On 30 Mar 2017, at 4.06, Andrew Shalit <alms at clozure.com> wrote:
> > 
> > choose-file-dialog
> > choose-new-file-dialog
> > choose-directory-dialog
> > 
> > I always have trouble remembering their names, too.
> > 
> > > 
> > > On Mar 29, 2017, at 8:34 PM, Laughing Water <lw at mt.net> wrote:
> > > 
> > > I’m embarrassed to ask, but I have failed to figure out how to
> > > successfully execute PROMPT-FOR-FILE. This is on Mac OS X 10.11.6
> > > and using a freshly-downloaded CCL 1.11-store-r16714 from the App
> > > Store.
> > > 
> > > ? (in-package :hi)
> > > #<Package "HI">
> > > ? (prompt-for-file)
> > > > 
> > > > Error: There is no applicable method for the generic function:
> > > >        #<STANDARD-GENERIC-FUNCTION HEMLOCK-ECHO-AREA-BUFFER
> > > > #x30200094AAAF>
> > > >      when called with arguments:
> > > >        (NIL)
> > > > While executing: #<CCL::STANDARD-KERNEL-METHOD NO-APPLICABLE-
> > > > METHOD (T)>, in process Listener(4).
> > > 
> > > I first laid my hands on MCL in 1990, have used LispWorks for
> > > over 10 years and wanted to try running some of my code in CCL. I
> > > was hoping for some instant gratification with a small piece of
> > > programming, but no success after an hour or more poring through
> > > documentation.
> > > 
> > > Laughing Water
> > > _______________________________________________
> > > Openmcl-devel mailing list
> > > Openmcl-devel at clozure.com
> > > https://lists.clozure.com/mailman/listinfo/openmcl-devel
> > 
> > _______________________________________________
> > Openmcl-devel mailing list
> > Openmcl-devel at clozure.com
> > https://lists.clozure.com/mailman/listinfo/openmcl-devel
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> https://lists.clozure.com/mailman/listinfo/openmcl-devel



More information about the Openmcl-devel mailing list