Class - How to check, if a class I want to create already exists and how to delete it?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Class - How to check, if a class I want to create already exists and how to delete it?

Dirk Klaschus
Hi, folks!

I'm new to Smalltalk, but I love it already. I have two questions, I
couldn't find answers for:

1) I have written a method which creates a new class. How can I check,
if the class I want to create does not exist already?
...
Object
      subclass: textKlassenname asSymbol
      instanceVariableNames: ''
      classVariableNames: ''
      poolDictionaries: ''
      category: 'ZFriend-Bibliothek'

2) I want to write a method, which deletes the created class. How can I
do it?


P.S.: I did not find any place to look it up for myself. Any hints where
to find such answers?


Thanks for your help!!!
Dirk


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Class - How to check, if a class I want to create already exists and how to delete it?

hernanmd
Hi Dirk,
  Welcome to Smalltalk!

2009/12/17 Dirk Klaschus <[hidden email]>:

> Hi, folks!
>
> I'm new to Smalltalk, but I love it already. I have two questions, I
> couldn't find answers for:
>
> 1) I have written a method which creates a new class. How can I check,
> if the class I want to create does not exist already?
> ...
> Object
>      subclass: textKlassenname asSymbol
>      instanceVariableNames: ''
>      classVariableNames: ''
>      poolDictionaries: ''
>      category: 'ZFriend-Bibliothek'

Smalltalk hasClassNamed: #Object

>
> 2) I want to write a method, which deletes the created class. How can I
> do it?
>

( Smalltalk at: #YourClass ) removeFromSystem

>
> P.S.: I did not find any place to look it up for myself. Any hints where
> to find such answers?
>
>
> Thanks for your help!!!
> Dirk

You're welcome.

Hernán
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project