Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Richard O'Keefe
I do wish people wouldn't say "beg the question" https://grammarist.com/rhetoric/begging-the-question-fallacy/ when they mean "invites" or "raises" the question. Sigh. Yes, Smalltalk is just like Lua here. |f g| "declare f and g as local variables" f := [... g value ...]. "f uses g's current

Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Brainstorms
Richard, Question from someone still fairly new to Smalltalk: To implement the example you gave regarding mutually recursive functions in Lua, one must write something like this: local f, g function g () f() end function f () g() end where the

Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Richard O'Keefe
Suppose you want a pair of mutually recursive functions. They have to be able to name each other. In languages like Python and Ruby, you can have methods AND you can have named functions. In fact Python had named functions before it had objects. But in Smalltalk, you have methods, which cannot be

Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread BrunoBB
Hi, Blocks are very useful when you need to evaluate code from an outside source. For example a BPM Process that have gateways with different conditions. To the Smalltalk system conditions come as Strings and convert them to Smalltalk objects is very easy: self evaluate: '[:process | process amou

Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Esteban Maringolo
On Wed, May 15, 2019 at 5:21 PM Tim Mackinnon wrote: > > On a similar line - I’ve often noticed that an interesting block pattern in > Smalltalk which is overlooked in other languages is how we handle errors > through them. > > We often don’t throw exceptions but instead pass a useful block (and

Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Tim Mackinnon
On a similar line - I’ve often noticed that an interesting block pattern in Smalltalk which is overlooked in other languages is how we handle errors through them. We often don’t throw exceptions but instead pass a useful block (and often 2) for what to do instead. at:ifAbsent: comes to mind or

Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Hilaire
Le 15/05/2019 à 20:37, Konrad Hinsen a écrit : > Lambda expressions are indeed Python's anonymous functions, but no > Python programmer would create a lambda expression only to assign it > to a variable. Doing this in an article to "sell" Smalltalk might well > have the opposite effect. Nor a Smal

[Pharo-users] upload a stack trace with playground

2019-05-15 Thread Roelof Wobben
Hello, I tried to upload a stack trace with playground  with upload to cloud but I see then a 400 bad request error message. I was a file of 3Kb. Is there a alternative so I can upload a stack trace. Roelof

Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Konrad Hinsen
Am 15.05.19 um 15:26 schrieb Atharva Khare: I think in python, you use Lambda Expressions. Here is how I would do it in python3: import math f = lambda x: math.cos(x) + x d_f = lambda x: (f(x + 1e-8) - f(x)) * 1e8 Lambda expressions are indeed Python's anonymous functions, but no Python prog

Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Tomaž Turk
Here's a nice description about JS: https://www.vinta.com.br/blog/2015/javascript-lambda-and-arrow-functions/ Best wishes, Tomaz -- Original Message -- From: "Hilaire" To: pharo-users@lists.pharo.org Sent: 15.5.2019 18:54:58 Subject: Re: [Pharo-users] Bloc of code in tiers programming

Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Hilaire
Hi, It is an important restriction on Python. So Javasctip has several way of doing lambda, correct? Thanks Hilaire Le 15/05/2019 à 16:19, Richard O'Keefe a écrit : > One point worth making is that Python lambdas are artificially restricted: > the body of a Python lambda may only be a single ex

Re: [Pharo-users] Pharo download with wget

2019-05-15 Thread BrunoBB
Hi, Thanks to all for information, this is finally fixed. On Centos 7.6 the fix is: sudo ln -s /usr/lib64/libcurl.so.4 /usr/lib64/libcurl-gnutls.so.4 In process i also executed (not sure if it had a direct impact on the fix): sudo yum install libgit2 regards, bruno -- Sent from: http://for

Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Hilaire
Thanks guys. -- Dr. Geo http://drgeo.eu

Re: [Pharo-users] Pharo download with wget

2019-05-15 Thread BrunoBB
Sorry i forgot to mention Linux is Centos 7.6 regards, bruno -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Re: [Pharo-users] Pharo download with wget

2019-05-15 Thread BrunoBB
Ben, Thanks for the links, i will research further on this. Ted, libcurl is v4 [gemstone@localhost ~]$ locate libcurl.so /usr/lib64/libcurl.so /usr/lib64/libcurl.so.4 /usr/lib64/libcurl.so.4.3.0 regards, bruno -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Richard O'Keefe
One point worth making is that Python lambdas are artificially restricted: the body of a Python lambda may only be a single expression, not a sequence of statements. This restriction is for ideological reasons (the BDFL does not *want* you to do that) not for technical reasons. Lisp and Algol 68

Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Tomaž Turk
In javascript I believe is var f = function(x) { return Math.cos(x) + x; } var df = function(x) { return f(x + 1e-8) - f(x) * 1e8; } Best wishes, Tomaz -- Original Message -- From: "Atharva Khare" To: "Any question about pharo is welcome" Sent: 15.5.2019 15:26:11 Subject: Re: [Pharo-u

Re: [Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Atharva Khare
Hey, I think in python, you use Lambda Expressions. Here is how I would do it in python3: import math f = lambda x: math.cos(x) + x d_f = lambda x: (f(x + 1e-8) - f(x)) * 1e8 On Wed, May 15, 2019 at 6:33 PM Hilaire wrote: > Hi, > > We, Smalltalkers, use bloc of code as easily as we breathe ai

[Pharo-users] Bloc of code in tiers programming language

2019-05-15 Thread Hilaire
Hi, We, Smalltalkers, use bloc of code as easily as we breathe air. I am writing an article on Smalltalk programming for a French mathematics teachers magazine. To illustrate the simplicity of Smalltalk, I would like to compare how the bloc of code 'f' and 'df' below will be implemented in Javas

Re: [Pharo-users] TelePharo / Seamless Bitmaps are all 0s

2019-05-15 Thread Alistair Grant
Hi Denis, On Wed, 15 May 2019 at 10:16, Denis Kudriashov wrote: > > Hi Alistair > > I will look when have a time. > But you can try to write a test for bitmap serialization/materialization in > TostSerializationTests (if I remember correctly the name). > It will show if bitmap transport requires

Re: [Pharo-users] TelePharo / Seamless Bitmaps are all 0s

2019-05-15 Thread Denis Kudriashov
Hi Alistair I will look when have a time. But you can try to write a test for bitmap serialization/materialization in TostSerializationTests (if I remember correctly the name). It will show if bitmap transport requires extra logic. ср, 15 мая 2019 г., 8:49 Alistair Grant : > Hi Denis, > > If I p

[Pharo-users] TelePharo / Seamless Bitmaps are all 0s

2019-05-15 Thread Alistair Grant
Hi Denis, If I print: remotePharo evaluate: [ Array withAll: #(42 42 42) ] "==> #(42 42 42)" which is obviously correct, but: remotePharo evaluate: [ Bitmap withAll: #(42 42 42) ] gives me a bitmap with all zeroes (running it locally does the expected thing). I can see that the bitmap is bein