[Pharo-users] scope shadowing problem.

2016-11-14 Thread CodeDmitry
Is there a way to stop Pharo from preventing me from shadowing blocks? [:superenv | |env| env := Dictionary new. [:superenv | |env| env := Dictionary new. [:superenv | |env| env := Dictionary new.

Re: [Pharo-users] How does Boolean ifTrue work?

2016-10-31 Thread CodeDmitry
That's a very interesting point; Even if Boolean messages is inlined into True and False, it provides a very convenient place to hook additional messages that are common to True and False to without needing to touch True nor False. -- View this message in context:

Re: [Pharo-users] How does Boolean ifTrue work?

2016-10-31 Thread CodeDmitry
I meant "dynamic" as a contrast to Java's abstract classes/interfaces which are going to slap you if you forget to implement one of the abstract methods, so the only reason to define the methods that are going to be overwritten seems to be to disambiguate the error message that will be raised

Re: [Pharo-users] How does Boolean ifTrue work?

2016-10-31 Thread CodeDmitry
I realized it a bit before you posted but thanks for confirming. Boolean seems to indeed just be a "Dynamic Interface"; since Smalltalk does not have "Java Interfaces"(nor want them for the same reason JavaScript doesn't), the developers wanted to still have True and False be subclasses of

Re: [Pharo-users] How does Boolean ifTrue work?

2016-10-31 Thread CodeDmitry
But still, how is the actual argument "alternativeBlock" passed to the True/False from a Boolean? The message does not cache the message inside itself before passing the message, and it does not pass the alternative block along with the message. -- View this message in context:

Re: [Pharo-users] How does Boolean ifTrue work?

2016-10-31 Thread CodeDmitry
Wait, so unlike JavaScript; True and False are actual singletons and ifTrue/ifFalse/ifTrue:ifFalse: uses visitor pattern to have the actual True or False handle the block rather than doing it themselves? -- View this message in context:

[Pharo-users] How does Boolean ifTrue work?

2016-10-31 Thread CodeDmitry
I am looking at ifTrue: alternativeBlock "If the receiver is false (i.e., the condition is false), then the value is the false alternative, which is nil. Otherwise answer the result of evaluating the argument, alternativeBlock. Create an error notification if the

[Pharo-users] What is the correct way to go around implementing a GUI feature in Pharo?

2016-10-22 Thread CodeDmitry
I want to have a bootstrap-like navbar at the top of my pharo GUI to store commonly accessed features/custom hierarchies of menus. My first thought is that I should spend a bunch of time playing with Morphs and invent my own MVC(models being the state managed by the menu, views being the

Re: [Pharo-users] How do Smalltalk disambiguate messages?

2016-10-16 Thread CodeDmitry
I define Magic as "An opaque abstraction or an abstraction you think is opaque until you learn better.", to a beginner, everything is deeply Magical. That said, much of Smalltalk's opaqueness is not due to the language, but due to me being a beginner. I'm sure there's a way to actually force

Re: [Pharo-users] How do Smalltalk disambiguate messages?

2016-10-16 Thread CodeDmitry
"Messages are very hard to implement if not impossible because they required that calls don't exist or be disabled, otherwise the existence of message is pointless. And since no language I am aware of allow you to disable calls and replace them with messages , what you trying to do is pointless ."

Re: [Pharo-users] How do Smalltalk disambiguate messages?

2016-10-16 Thread CodeDmitry
I tried so hard to find an example of Ruby using smalltalk message syntax. You can do something like: class Dictionary attr_accessor :dict def initialize() @dict = {} end def at(*args) if (args.length == 1) then return @dict[args[0]]

Re: [Pharo-users] How do Smalltalk disambiguate messages?

2016-10-15 Thread CodeDmitry
So "at: x put: y" translates to a method named #at:put:(or "at:put:")? |dict| dict := Dictionary new. dict at: 'foo' put: 'bar'. So javascript equivalent would be(assuming the Dictionary object existed). var dict; dict = new Dictionary; dict['at:put:']('foo', 'bar'); -- View this message in

Re: [Pharo-users] How do Smalltalk disambiguate messages?

2016-10-15 Thread CodeDmitry
I understand that it is a single message send, but to know how to handle the message at runtime, the parser needs to somehow determine where the implementation of that message is. It must do a lookup based on multiple keys(at, and put), which is really confusing. "methods" are easy to look up

[Pharo-users] How do Smalltalk disambiguate messages?

2016-10-15 Thread CodeDmitry
I am trying to do a JavaScript experiment to make Objects behave like Smalltalk objects. example: "reminder: Smalltalk arrays start at 1." |arr| a := Array new: 1. a at: 1 put: 'Hello, World'. Here, the Smalltalk array has a message "at: index put: value" which is defined

Re: [Pharo-users] Intro to Microsoft COM for Smalltalkers

2016-10-03 Thread CodeDmitry
You seem to have answered my question as I was revising it D: -- View this message in context: http://forum.world.st/Intro-to-Microsoft-COM-for-Smalltalkers-tp4917738p4917916.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Re: [Pharo-users] Intro to Microsoft COM for Smalltalkers

2016-10-03 Thread CodeDmitry
LOL (in GrowlMorph): is: rect saneWithRespectTo: morphs ^(morphs anySatisfy: [ :morph | morph owner isNotNil and: [morph bounds intersects: rect]]) not for some reason I find this method name quite amusing :3 Let me guess; 1. "World defer: aBlock." defers the event to be called as

Re: [Pharo-users] Pharo on my Ubuntu laptop :3

2016-10-03 Thread CodeDmitry
Sounds exciting, I've been trying to tweak the window buttons but couldn't figure out where to look. -- View this message in context: http://forum.world.st/Pharo-on-my-Ubuntu-laptop-3-tp4917833p4917846.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Re: [Pharo-users] Intro to Microsoft COM for Smalltalkers

2016-10-03 Thread CodeDmitry
Interesting, I got to play around with these, do some async morph animations. -- View this message in context: http://forum.world.st/Intro-to-Microsoft-COM-for-Smalltalkers-tp4917738p4917839.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Re: [Pharo-users] Intro to Microsoft COM for Smalltalkers

2016-10-03 Thread CodeDmitry
a JavaScript timeout is a function that takes a block and a period of time, and after this period of time, puts the block at the end of the event queue, to be executed as soon as the runtime is done performing the tasks in front of it. I am not sure if Pharo has an event queue, so it's a bit

[Pharo-users] Pharo on my Ubuntu laptop :3

2016-10-03 Thread CodeDmitry
Behold! -- View this message in context: http://forum.world.st/Pharo-on-my-Ubuntu-laptop-3-tp4917833.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Re: [Pharo-users] Intro to Microsoft COM for Smalltalkers

2016-10-02 Thread CodeDmitry
Contribution is something I've been thinking about for quite some time because it's interesting how a lot of software is declared "open" but make it not obvious what you can do to help, or at least participate, or just take a glimpse at the code to see if something stands out. I am a believer

Re: [Pharo-users] Intro to Microsoft COM for Smalltalkers

2016-10-02 Thread CodeDmitry
@kilon.alios [1] I like C++/CLI more than C# because it is very refreshing to use a language capable of using managed memory and unmanaged memory. I am too used to being in languages where garbage collection is forced on you and everything must be done via new or stack types such as Java, most

Re: [Pharo-users] Intro to Microsoft COM for Smalltalkers

2016-10-02 Thread CodeDmitry
To be fair, C++CLI is quite a pleasure to code, it's a very refreshing technology that sits nicely on the barrier of runtime and compiletime, similar to Objective C; eg still has access to unmanaged resources, while still having managed resources in contrast to Java/C# which kinda go one step

[Pharo-users] Intro to Microsoft COM for Smalltalkers

2016-10-01 Thread CodeDmitry
Just made this image, I thought it would be fun to share :3 (Yes there are a few memory leaks there due to no SysFreeString to match SysAllocString, but regardless... http://i.imgur.com/Fz36SHU.png COM to Microsoft Windows seems to be like Smalltalk to Smalltalk Runtime, with Object Browser