Pattern, Abstract Factory / Factory

Hans Hübner hans.huebner at gmail.com
Sun Feb 7 08:45:56 UTC 2021


Am So., 7. Feb. 2021 um 09:35 Uhr schrieb Manfred Bergmann <
manfred.bergmann at me.com>:

> > Am 07.02.2021 um 09:23 schrieb Hans Hübner <hans.huebner at gmail.com>:
> >
> > Am So., 7. Feb. 2021 um 09:20 Uhr schrieb Manfred Bergmann <
> manfred.bergmann at me.com>:
> > But fundamentally, you also can’t create an instance of a class in
> Common Lisp from just the symbol. The class definition must be known.
> >
> > This simply is untrue.  You can use FIND-CLASS to find a class named by
> a symbol and then instantiate it.
>
> Well, OK. Sure. But when I do that I have again a dependency on the
> concrete class, or? And it would be similar as knowing the class right from
> the start.
>

You don't.  You have a dependency on the name of a class.  The name could
refer to two entirely different classes between invocations of FIND-CLASS.
The name could also come from an external source.  Thus, this is purely a
run-time dependency and it would be quite possible that FIND-CLASS returns
NIL if given a symbol that does not designate a currently-defined class.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/pro/attachments/20210207/c7f1e514/attachment.html>


More information about the pro mailing list