[plt-scheme] make-object return value

From: Ron Stanonik (stanonik at Cogsci.ucsd.edu)
Date: Mon Mar 17 14:02:42 EST 2003

Sorry for the novice question.

Is it possible for class instantiation to return something other
than an instance?  Say, #f, to indicate that an error occurred?

I'm creating a class that will extract information from pdf's.
(A jpeg of the first page, jpegs of the images in the document,
author, title, creation date, if available.)

  (define a (make-object pdf% "/tmp/a.pdf"))

If the user passes a file which isn't a pdf, then I could raise
an exception, but if make-object just returned #f, that would be
sufficient.

Thanks,

Ron



Posted on the users mailing list.