[plt-scheme] make-object return value
At Mon, 17 Mar 2003 11:02:42 -0800 (PST), Ron Stanonik wrote:
> Is it possible for class instantiation to return something other
> than an instance? Say, #f, to indicate that an error occurred?
No.
> 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.
You'll have to raise an exception, I think.
Matthew