How to make Pharo produce random garbage bytes

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

How to make Pharo produce random garbage bytes

niko.schwarz
Hi list, I learned something fun today from a friend, how to make
Pharo produce random garbage!

 Make a class AC which is defined as:
 Object subclass: #AC
       instanceVariableNames: 'a'
       classVariableNames: ''
       poolDictionaries: ''
       category: 'OB-Standard-Browsers'

Then you make a second class AB defined as:

Object variableByteSubclass: #AB
       instanceVariableNames: ''
       classVariableNames: ''
       poolDictionaries: ''
       category: 'OB-Standard-Browsers'

Then you make accessors for 'a' in AC
Now execute: AB superclass: AC
And then you do "AB new a" which gives you back random data.


Cheers,

Niko

_______________________________________________
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: How to make Pharo produce random garbage bytes

Lukas Renggli
If you are up to that kind of random data you can also try

   Object new executeMethod: (Point >> #x)

Lukas

2009/10/28 Niko Schwarz <[hidden email]>:

> Hi list, I learned something fun today from a friend, how to make
> Pharo produce random garbage!
>
>  Make a class AC which is defined as:
>  Object subclass: #AC
>       instanceVariableNames: 'a'
>       classVariableNames: ''
>       poolDictionaries: ''
>       category: 'OB-Standard-Browsers'
>
> Then you make a second class AB defined as:
>
> Object variableByteSubclass: #AB
>       instanceVariableNames: ''
>       classVariableNames: ''
>       poolDictionaries: ''
>       category: 'OB-Standard-Browsers'
>
> Then you make accessors for 'a' in AC
> Now execute: AB superclass: AC
> And then you do "AB new a" which gives you back random data.
>
>
> Cheers,
>
> Niko
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
http://www.lukas-renggli.ch

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