[Pharo-project] What is a primitive method?

Eliot Miranda eliot.miranda at gmail.com
Thu Oct 21 18:50:54 EDT 2010


Hi Oscar,

    see Object class>>whatIsAPrimitive.  Further, most of the primitive
methods you're seeing are methods that answer self, nil, true false or an
inst var.  See the difference between these:

SystemNavigation new browseAllSelect: [:m| m isQuick]

SystemNavigation new browseAllSelect: [:m| m primitive > 0 and: [m isQuick
not]]

SystemNavigation new browseAllSelect: [:m| m primitive > 0 and: [m isQuick
not and: [(#(117 120) includes: m primitive) not]]]

HTH
Eliot

On Thu, Oct 21, 2010 at 9:18 AM, Oscar E A Callau <oalvarez at dcc.uchile.cl>wrote:

>
> Hi all,
>
>     I have a (basic) question:
>
> What is a primitive method?
>
> In pharo 1.1.1, we have CompiledMethod>>primitive that basically return:
>
> 0 if the method is not a primitive method
> >0 otherwise
>
> But if you execute this on i.e. Number>>isNumber or Morph>>#model compiled
> methods you get that these two are primitive methods. Are they primitive
> methods?
>
> Other (related) question is: When I executed the expression:
>
> SystemNavigation default allPrimitiveMethods
>
> , I get a OrderedCollection with 5581 elements. Are all those methods,
> primitive methods?
>
>
> Thanks in advance
> _______________________________________________
> Pharo-project mailing list
> Pharo-project at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20101021/a25a16c4/attachment-0001.html>


More information about the Pharo-dev mailing list