Giter Club home page Giter Club logo

Comments (6)

nbecu avatar nbecu commented on May 28, 2024

As u understood, we used this bad habit (refering to protocol names) a lot.
I recommand we start changing on a 'simple' example' and that would be the use of protocol name to fetch the probes methods.

Perhaps u could show us how to code this right and then we can use the same syntax for other cases.
The code to change is in the probes method of CormasModel and of Cormas Entity.
for the moment it is like this.

probes
^(self organization listAtCategoryNamed: #probes) asSortedCollection

Can u show us how to swith to using pragmas on this example.
Thanks

from cormas.

SergeStinckwich avatar SergeStinckwich commented on May 28, 2024

Load Cormas-Model-ECEC-SergeStinckwich.15 and Cormas-Core-SergeStinckwich.118, to have one example of using Pragma for probes.

from cormas.

nbecu avatar nbecu commented on May 28, 2024

cool. easy indeed.

i've done the same for local probes (meaning, probes on the instances of an
entity class). there is one in ECEC, it is on the energy of the foragers.
The code works
http://ws.stfx.eu/GZI5UVJQH0W6
but when i plot it, i get weird results

[image: Images intégrées 1]

2015-06-03 10:19 GMT+02:00 Serge Stinckwich [email protected]:

Load Cormas-Model-ECEC-SergeStinckwich.15 and
Cormas-Core-SergeStinckwich.118, to have one example of using Pragma for
probes.


Reply to this email directly or view it on GitHub
#10 (comment).

from cormas.

SergeStinckwich avatar SergeStinckwich commented on May 28, 2024

I can't see the image. Images can't be used on github issues.

Sent from my iPhone

On 3 juin 2015, at 12:12, nbecu [email protected] wrote:

cool. easy indeed.

i've done the same for local probes (meaning, probes on the instances of an
entity class). there is one in ECEC, it is on the energy of the foragers.
The code works
http://ws.stfx.eu/GZI5UVJQH0W6
but when i plot it, i get weird results

[image: Images intégrées 1]

2015-06-03 10:19 GMT+02:00 Serge Stinckwich [email protected]:

Load Cormas-Model-ECEC-SergeStinckwich.15 and
Cormas-Core-SergeStinckwich.118, to have one example of using Pragma for
probes.


Reply to this email directly or view it on GitHub
#10 (comment).


Reply to this email directly or view it on GitHub.

from cormas.

nbecu avatar nbecu commented on May 28, 2024

Copy from a email exchange between Peter, Serge and Nicolas


While prefixing the protocol name with "+" or "-" may not be common, using "public" or "private" prefix is actually rather common.

Yes, rather uncommon in the Smalltalk world.
I don't remember Nicolas, what was the meaning of + and * ?
'+' is used for public methods which we want modelers ta have access to easily when browsing classes

'* ' is the same as +, but more specifically dedicated to model users. I explain this a bit more. In Cormas, we provide tools for model users (none developers) to interact with the simulation. That is for example, clicking on an entity in the sapceInterface, and then having a list of methods that the model user can send to that entity.s SO those * methods are methods that appear in those interactive menus.

So you know understand that in Cormas we make a distinction between model developers, and model users. The last category is not supposed to code or to see code. Following this logic, we have a packaging tool in cormas. You can either create a cormas modeler package (which gives access to the browser and all vw tools), or model user package (which gives access to only one model and no access to the browser or other vw tools)

​It makes more sense to express this kind of information at protocol level, because then the user can quickly filter out which methods one can use. If it was in pragma then you would have to go through the methods one by one or write custom tool to filter the methods.
And since some classes are rather large (CormasModel has 349 methods in Pharo), having a way to meaningfully separate them is essential.

Of course other approaches can be used... for example Spec (Pharo's UI builder) uses prefix "api" ("api", "api-building", "api-events", ...) to show which protocols are public; the rest is either in "private" or in unprefixed protocols.

from cormas.

olekscode avatar olekscode commented on May 28, 2024

Related to #329

from cormas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.