--
You received this message because you are subscribed to the Google Groups "Newspeak Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to newspeaklangua...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/newspeaklanguage/bf6ec262-db5c-4eb2-876e-d99d0734df87n%40googlegroups.com.
Gilad,I just watched the videos and finally read this thread. This is really cool.
- Are the exemplars always extracted from the comment before the " = (..)" section defining the factory constructor, instance method or class method,
or can the :exemplar: section be in any comment inside the method, factory or class method?
- If one has a class and wants to add an :exemplar: to it properly, one has to be dilligent and add them *on every method that provides instance "inputs"* - constructors, instance and class methods - otherwise evaluations in places that relies on some un-exemplared section would be confusing or incorrect (using nil or something like that?), is that a reasonable assumption?
Also, I assume that super factories and methods need to be exemplared for it to fully function.
Or is there perhaps some tool that checks missing exemplar inputs througout the class definition?
- Answer to this is probably obvious, but here: In the video, the debug context is acquired from the :exemplar: after you clicked the debug button. I should try this all myself, instead of asking but, I assume if we are debugging in the context of some application, the debug values will be from that context, rather than the exemplar right?
I am thinking if the running code is missing some value, it would not be placed in from an exemplar :)
- Not about exemplars - I noticed you used balance_slot not balanceSlot. It has been a wish of mine for a long time that underscores are accepted as the prefered word separator in naming, rather than camel case :) Is that a accident or a sign of intention? :)
Hi Milan,On Sat, Aug 7, 2021 at 5:44 PM Milan Zimmermann <milan.zi...@gmail.com> wrote:Gilad,I just watched the videos and finally read this thread. This is really cool.Thanks.- Are the exemplars always extracted from the comment before the " = (..)" section defining the factory constructor, instance method or class method,Yes. There can in fact be multiple exemplar comments. An exemplar comment is one whose identifer (the name given between colons in the tag at the beginning of the comment) starts with #exemplar. For example, we can define a method #foo:public foo: x (* :exemplar_1: foo: 3 *) (* an random comment *) (:exemplar_2: foo: 'a' *) = (^x)
In that case, the Debug button will provide a menu of the two exemplars .
or can the :exemplar: section be in any comment inside the method, factory or class method?No. Exemplar comments are just an instance of the general notion of metadata comments. You can have metadata comments everywhere, but there are general rules for what AST node a metadata comment applies to. Exemplar comments must apply to the method as a whole, and must go just before the method body starts (or for classes, before factory body starts) so that they apply to the correct AST nodes. The mirror system looks for metadata for methods and classes in these places. You can look at the methods #metadata and #parseMetadata in MethodMirror and ClassHeaderMirror, to see how this works; also the class MetadataParsing.
- If one has a class and wants to add an :exemplar: to it properly, one has to be dilligent and add them *on every method that provides instance "inputs"* - constructors, instance and class methods - otherwise evaluations in places that relies on some un-exemplared section would be confusing or incorrect (using nil or something like that?), is that a reasonable assumption?No, this is not the case. Each exemplar will define bindings, and these will be used to call any other methods independently.
Also, I assume that super factories and methods need to be exemplared for it to fully function.No. See above.Or is there perhaps some tool that checks missing exemplar inputs througout the class definition?No there isn't, and there is no need.- Answer to this is probably obvious, but here: In the video, the debug context is acquired from the :exemplar: after you clicked the debug button. I should try this all myself, instead of asking but, I assume if we are debugging in the context of some application, the debug values will be from that context, rather than the exemplar right?Yes. Also if you open an Object inspector, and look at the class in that context, the binding of Self comes from the object being inspected, not from the class exemplar.
I am thinking if the running code is missing some value, it would not be placed in from an exemplar :)True.- Not about exemplars - I noticed you used balance_slot not balanceSlot. It has been a wish of mine for a long time that underscores are accepted as the prefered word separator in naming, rather than camel case :) Is that a accident or a sign of intention? :)I should be more careful to use consistent conventions.I'm not sure I have a strong position/opinion here. In any case, _ is legal in identifiers.
And beware, this stuff is still very buggy.
--Cheers, Gilad
Thanks Gilad. A few notes - essentially notes to myself only except one confirmation ;) - inlineOn Saturday, 7 August 2021 at 18:31:33 UTC-7 Gilad Bracha wrote:- If one has a class and wants to add an :exemplar: to it properly, one has to be dilligent and add them *on every method that provides instance "inputs"* - constructors, instance and class methods - otherwise evaluations in places that relies on some un-exemplared section would be confusing or incorrect (using nil or something like that?), is that a reasonable assumption?No, this is not the case. Each exemplar will define bindings, and these will be used to call any other methods independently.Hmm, so in your video if the exemplar on the factory method#balance: bwas missing, the exemplar instance would not even be shown in the IDE?
Yes. Also if you open an Object inspector, and look at the class in that context, the binding of Self comes from the object being inspected, not from the class exemplar.Ok. I will take a look at that.
Well I am sure it is good for some basic experiments. I think you mentioned the server.zip is on the same level as online, so I will use that. (I have on my list next to learn how to build everything)
And I just updated servable.zip. May take a minute or to percolate thru, and then everything should be consistent.
--
You received this message because you are subscribed to the Google Groups "Newspeak Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to newspeaklangua...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/newspeaklanguage/CAOq-cNx-ung0P%2BAywKzB9EtwaV%3D8hVLPZ0DtwKuz7FPs0deF8A%40mail.gmail.com.
You received this message because you are subscribed to a topic in the Google Groups "Newspeak Programming Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/newspeaklanguage/cPG5Q6NOwiA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to newspeaklangua...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/newspeaklanguage/01333d8c-e16b-47c0-b839-ecbbc566660cn%40googlegroups.com.