Re: [Pharo-users] Hmmm sending at:put: to an undefined object (nil) gives a confusing error message

2019-03-11 Thread Richard O'Keefe
I understand #basicAt:[put:] being in Object, but I never understood
#at:[put:] being there.
GNU Smalltalk:
st> nil at: 1
Object: nil error: Invalid value nil: object not indexable
In my Smalltalk, you get a DNU.
In Squeak you get a debugger window with title
Error: instances of UndefinedObject are not indexable
The same for Boolean, Character, and Integer,
except Squeak where (20 factorial at: 1) answers 0 (oh dear oh dear oh
dear).
In VW you get a "Subscript out of bounds" error, which is disappointing,
as do true and $a, but a LargePositiveinteger gets #shouldNotImplement.


On Tue, 12 Mar 2019 at 15:28, Tim Mackinnon  wrote:

> If you forget to initialise a variable which you thought was a Dictionary
> - you get a confusing error message: "Error: only integers should be used
> as indices” if you try an at:put:
>
> This is a consequence of having at:put: defined on Object (which is a bit
> nasty)
>
> Should UndefinedObject at least override this and signal something a bit
> more obvious? This is a common and easily done thing and we don't support
> it very well.
> I just did it in some code, and was scratching my head initially until I
> read the stack properly and realised it was something much simpler than I
> thought I had done.
>
> Any thoughts on this?
>


[Pharo-users] Calypso openOnGroup?

2019-03-11 Thread Hernán Morales Durand
Hi,

Is there any way to open a browser on a method group in Claypso?

This was possible in Nautilus:

Smalltalk tools browser
openOnCategory: #compiling
ofClass: Class

Cheers,

Hernán



[Pharo-users] Hmmm sending at:put: to an undefined object (nil) gives a confusing error message

2019-03-11 Thread Tim Mackinnon
If you forget to initialise a variable which you thought was a Dictionary - you 
get a confusing error message: "Error: only integers should be used as indices” 
if you try an at:put:

This is a consequence of having at:put: defined on Object (which is a bit nasty)

Should UndefinedObject at least override this and signal something a bit more 
obvious? This is a common and easily done thing and we don't support it very 
well.

I just did it in some code, and was scratching my head initially until I read 
the stack properly and realised it was something much simpler than I thought I 
had done.

Any thoughts on this?

Re: [Pharo-users] Pharo OSX bundle in Mojave - how to sign ? (Was Re: OS X bundle, some progress)

2019-03-11 Thread Hilaire
Hi,

Today I realized another problem on some Mac OSX. It looks like when you
download an app on the net, whenever your run it, OS X re-localizes it
on a read only location. A guess a protection measure. It leads to
obvious problem.

For example, once I download DrGeo and run it, the image location
resolve to this place:

/private/var/folders/bb/spq6th0s7814jgk9nybbqjrw45hrqn/T/AppTranslocation/D0FEC575-60D6-4F2B-A1C3-3259271B9C92/d/DrGeo.app/Contents/Resources

I don't have the global picture and it is hard to understand what's
going on.

Moving to the Application place seems to resolve the issue. But some
users told me they have to move DrGeo from Download, then Application,
then back to Download to get it running without RW error.

What a strange world.

Guys, what about throwing away these Mac, the promise of freedom[1] is
longtime twisted :-)

Ok just kidding, well half-kidding.

Hilaire

[1] https://www.youtube.com/watch?v=2zfqw8nhUwA

Le 09/03/2019 à 10:10, Cédrick Béler a écrit :
> Hi,
>
> I tried a bit more to make DrGeo bundle works.
>
> I have Mojave (10.14) and the problem of corrupted files seems to come from 
> Gatekeeper with prevent unsigned applications (from unknot developper) to 
> open.
>
> Gatekeeper can be temporary stopped and then the bundle work, even when 
> Gatekeeper is reactivated. But clearly, this is not a friendly user way of 
> installing DrGeo.
>
> So I guess the actual (old ?) bundle procedure doesn’t fit Apple politic on 
> application security. I'm pretty sure PharoLauncher faced this already.
>
> So my question is:
> - how to make a signed bundle for OSX ?
> — do we need a real developer account ? I’ve a free one and access to a paid 
> one. Can we do it with a general « pharaoh » account like for Pharo-Launcher ?
>
>
> Cheers,
>
> Cédrick

-- 
Dr. Geo
http://drgeo.eu





Re: [Pharo-users] Pharo and FPGA

2019-03-11 Thread Noury Bouraqadi
Hi Norbert,

The PhD of Sang (in CC) was about FPGA and Smalltalk.
https://lxsang.me/

Noury

> On 9 Mar 2019, at 15:31, Norbert Hartl  wrote:
> 
> I’m trying to collect information about programming in pharo for FPGA. The 
> only things I found are around PharoROS like this [1]. If anyone has more 
> information or is willing to talk about I’m open ears.
> 
> The background is that we did little things with the PharoThings toolkit and 
> want to research which other combinations like Arduino, ESP32, FPGAs are 
> there to be a good extensions to a Pi.
> 
> Any hint is welcomed!
> 
> Thanks,
> 
> Norbert
> 
> [1] 
> http://esug.org/data/ESUG2014/IWST/Papers/iwst2014_From%20Smalltalk%20to%20Silicon_Towards%20a%20methodology%20to%20turn%20Smalltalk%20code%20into%20FPGA.pdf




Re: [Pharo-users] complex json parsing.

2019-03-11 Thread Ben Coman
On Mon, 11 Mar 2019 at 14:35, Roelof Wobben  wrote:

> Op 11-3-2019 om 00:03 schreef Ben Coman:
> > collectionUrl :=
> > '
> https://www.rijksmuseum.nl/api/nl/collection?key=14OGzuak=json=schilderij=True
> '.
> > json := NeoJSONReader fromString: (ZnEasy get: collectionUrl)
> > contents.
> > paintings := Paintings fromJSON: json.
>
> Thanks a lot , Ben
>
> I almost gave it up but I think I see a way to solve this
>
> The first part gives back exactly the same output as my old code.
> For the new one I have to do some trying but I think I can solve it
>

great !!
Now it occurred to me that your approach seemed to be "based from applying
functions to manipulate data that happens to be stored in an object",
whereas you should invert that philosophy so you are "thinking from inside
the object".  What data do "I" have and what can "I" do with it.

A great read that will help you is "A Mentoring Course in Smalltalk"
http://www.lulu.com/au/en/shop/andres-valloud/a-mentoring-course-on-smalltalk/paperback/product-3788890.html

cheers -ben


Re: [Pharo-users] complex json parsing.

2019-03-11 Thread Roelof Wobben

Op 11-3-2019 om 00:03 schreef Ben Coman:
collectionUrl :=  
'https://www.rijksmuseum.nl/api/nl/collection?key=14OGzuak=json=schilderij=True'.
    json := NeoJSONReader fromString: (ZnEasy get: collectionUrl) 
contents.

    paintings := Paintings fromJSON: json.


Thanks a lot , Ben

I almost gave it up but I think I see a way to solve this

The first part gives back exactly the same output as my old code.
For the new one I have to do some trying but I think I can solve it

Roelof