Re: [Pharo-users] Macros?

2018-05-25 Thread Clément Bera
Just mentioning another use-case:

getDatabaseInstance
^ (Production CifTrue: [Database] CifFalse: [MockDatabase]) new

Since I use conditional compilation more often than just precompiling
constants.

I don't see an equivalent of asMethodConstant AST manipulation at runtime
strategy in the image for this case right now but it's probably a couple
lines of code with Reflectivity.

On Sat, May 26, 2018 at 7:28 AM, Clément Bera 
wrote:

>
>
> On Fri, May 25, 2018 at 10:44 PM, Esteban Lorenzano 
> wrote:
>
>>
>>
>> On 25 May 2018, at 17:30, Clément Bera  wrote:
>>
>> What about a preprocessor like the Java preprocessors ? The Truffle
>> project relies heavily on that for high performance Java and it's quite
>> nice. It's difficult to do that in Smalltalk right now.
>>
>> I think if you want to do what are asking for you just need to write a
>> bytecode compiler extension.
>>
>> I did something similar in the past to have precomputed constants through
>> AST manipulation at compilation time. You can find it here with examples:
>> http://smalltalkhub.com/#!/~ClementBera/NeoCompiler. Once the code is
>> loaded you need to recompile the examples (NeoCompilerExample
>> withAllSubclassesDo: #compileAll.). With it you can write code such as:
>> [ Smalltalk vm class ] Cvalue
>> And depending if the compiler allowsPrecompilation or not, the bytecode
>> compiler generates:
>> Smalltalk vm class
>> Or just a push literal with the precomputed value (the class
>> VirtualMachine).
>>
>>
>> this is not what #asMethodConstant provides?
>>
>
> Can you turn asMethodConstant On and Off so you have the constant in
> production and not a development time ? Typically at development time I
> change the constants generated a lot and I don't want to waste time
> recompiling all the time.
>
> But yeah, my project is from 2014. I guess instead of preprocessing you
> could do everything at runtime with AST manipulation/recompilation like
> in asMethodConstant.
>
> The main point of preprocessing IMO is to control performance, it's just
> easier for me to just look at the generated bytecode and change the
> preprocessor until it gets what I want, it's not always easy to run code
> that will change your method at runtime quickly so you can look at the
> bytecode generated.
>
> Anyway, I am not convinced at all something like that should be in the
> base image.
>
>
>>
>> Esteban
>>
>> In the end I decided not to use this, but you can use it and extend it to
>> support more than just constants (any AST manipulation is possible).
>> Just checked it works in Pharo 6.
>>
>> On Fri, May 25, 2018 at 4:26 PM, Stephan Eggermont 
>> wrote:
>>
>>> Debiller 777 
>>> wrote:
>>> > Well, I've already asked about adding new literals to pharo or
>>> Smalltalk in
>>> > general, however this time I have a better idea:
>>> > macros. Can they be added? Because if I understand correctly they may
>>> be
>>> > the only way to do that.
>>>
>>> Why do you think they would be a good idea? We have powerful
>>> meta-programming facilities that are well understood and somewhat
>>> supported
>>> by tooling. How do we get value out of macros?
>>>
>>> Stephan
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Clément Béra
>> https://clementbera.github.io/
>> https://clementbera.wordpress.com/
>>
>>
>>
>
>
> --
> Clément Béra
> https://clementbera.github.io/
> https://clementbera.wordpress.com/
>



-- 
Clément Béra
https://clementbera.github.io/
https://clementbera.wordpress.com/


Re: [Pharo-users] Macros?

2018-05-25 Thread Clément Bera
On Fri, May 25, 2018 at 10:44 PM, Esteban Lorenzano 
wrote:

>
>
> On 25 May 2018, at 17:30, Clément Bera  wrote:
>
> What about a preprocessor like the Java preprocessors ? The Truffle
> project relies heavily on that for high performance Java and it's quite
> nice. It's difficult to do that in Smalltalk right now.
>
> I think if you want to do what are asking for you just need to write a
> bytecode compiler extension.
>
> I did something similar in the past to have precomputed constants through
> AST manipulation at compilation time. You can find it here with examples:
> http://smalltalkhub.com/#!/~ClementBera/NeoCompiler. Once the code is
> loaded you need to recompile the examples (NeoCompilerExample
> withAllSubclassesDo: #compileAll.). With it you can write code such as:
> [ Smalltalk vm class ] Cvalue
> And depending if the compiler allowsPrecompilation or not, the bytecode
> compiler generates:
> Smalltalk vm class
> Or just a push literal with the precomputed value (the class
> VirtualMachine).
>
>
> this is not what #asMethodConstant provides?
>

Can you turn asMethodConstant On and Off so you have the constant in
production and not a development time ? Typically at development time I
change the constants generated a lot and I don't want to waste time
recompiling all the time.

But yeah, my project is from 2014. I guess instead of preprocessing you
could do everything at runtime with AST manipulation/recompilation like
in asMethodConstant.

The main point of preprocessing IMO is to control performance, it's just
easier for me to just look at the generated bytecode and change the
preprocessor until it gets what I want, it's not always easy to run code
that will change your method at runtime quickly so you can look at the
bytecode generated.

Anyway, I am not convinced at all something like that should be in the base
image.


>
> Esteban
>
> In the end I decided not to use this, but you can use it and extend it to
> support more than just constants (any AST manipulation is possible).
> Just checked it works in Pharo 6.
>
> On Fri, May 25, 2018 at 4:26 PM, Stephan Eggermont 
> wrote:
>
>> Debiller 777 
>> wrote:
>> > Well, I've already asked about adding new literals to pharo or
>> Smalltalk in
>> > general, however this time I have a better idea:
>> > macros. Can they be added? Because if I understand correctly they may be
>> > the only way to do that.
>>
>> Why do you think they would be a good idea? We have powerful
>> meta-programming facilities that are well understood and somewhat
>> supported
>> by tooling. How do we get value out of macros?
>>
>> Stephan
>>
>>
>>
>>
>
>
> --
> Clément Béra
> https://clementbera.github.io/
> https://clementbera.wordpress.com/
>
>
>


-- 
Clément Béra
https://clementbera.github.io/
https://clementbera.wordpress.com/


Re: [Pharo-users] Macros?

2018-05-25 Thread Esteban Lorenzano


> On 25 May 2018, at 17:30, Clément Bera  wrote:
> 
> What about a preprocessor like the Java preprocessors ? The Truffle project 
> relies heavily on that for high performance Java and it's quite nice. It's 
> difficult to do that in Smalltalk right now.
> 
> I think if you want to do what are asking for you just need to write a 
> bytecode compiler extension.
> 
> I did something similar in the past to have precomputed constants through AST 
> manipulation at compilation time. You can find it here with examples: 
> http://smalltalkhub.com/#!/~ClementBera/NeoCompiler 
> . Once the code is 
> loaded you need to recompile the examples (NeoCompilerExample 
> withAllSubclassesDo: #compileAll.). With it you can write code such as:
> [ Smalltalk vm class ] Cvalue
> And depending if the compiler allowsPrecompilation or not, the bytecode 
> compiler generates:
> Smalltalk vm class 
> Or just a push literal with the precomputed value (the class VirtualMachine).

this is not what #asMethodConstant provides?

Esteban

> In the end I decided not to use this, but you can use it and extend it to 
> support more than just constants (any AST manipulation is possible).
> Just checked it works in Pharo 6.
> 
> On Fri, May 25, 2018 at 4:26 PM, Stephan Eggermont  > wrote:
> Debiller 777 >
> wrote:
> > Well, I've already asked about adding new literals to pharo or
> Smalltalk in
> > general, however this time I have a better idea:
> > macros. Can they be added? Because if I understand correctly they may be
> > the only way to do that.
> 
> Why do you think they would be a good idea? We have powerful
> meta-programming facilities that are well understood and somewhat supported
> by tooling. How do we get value out of macros?
> 
> Stephan
> 
> 
> 
> 
> 
> 
> -- 
> Clément Béra
> https://clementbera.github.io/ 
> https://clementbera.wordpress.com/ 


Re: [Pharo-users] [Pharo-dev] feenk log

2018-05-25 Thread Norbert Hartl
Very impressive!! Hope Bloc and Brick move along to be included in pharo soon!!

Norbert

> Am 25.05.2018 um 13:30 schrieb Tudor Girba :
> 
> Hi,
> 
> We were a bit silent the last couple of months. Quite a bit happened in the 
> meantime, so here is a summary (for more fine grained announcements, you can 
> follow us on Twitter):
> 
> 
> Bloc
> 
> 
> - Scrolling. We finally have a good scrolling support:
> https://twitter.com/feenkcom/status/991690465224331264
> This might sound like a trivial feature, but it turns out it is not. We had a 
> bug that forced us to rethink the support quite deeply in order to be able to 
> debug it. To do this, we now can simulate time in Bloc, which is really cool:
> https://twitter.com/feenkcom/status/989797367523233797
> https://twitter.com/feenkcom/status/988753142299938817
> (as a side note, the bug we fought with was the last 
> 
> - Pannable element is a combination of a scrollable element with a scalable 
> element, and it offers the possibility either to zoom in/out + scroll, or to 
> fit screen and resize when the parent resizes.
> 
> - PDF, SVG, PNG, JPG export (based on the underlying Moz2D support):
> https://twitter.com/feenkcom/status/976580153802358786
> https://twitter.com/feenkcom/status/976578060429484032
> 
> - Better curve support:
> https://twitter.com/feenkcom/status/990967109193781249
> https://twitter.com/feenkcom/status/990971530615107584
> 
> - Better debugging support for understanding bounds:
> https://twitter.com/feenkcom/status/989138457288167424
> 
> 
> Brick
> 
> 
> - We now have simple list and columned list widgets. The list is both fast 
> and scalable and supports rows of variable heights:
> https://twitter.com/feenkcom/status/984744251920658432
> https://twitter.com/feenkcom/status/984143821192744961
> 
> - Basic tab widget:
> https://twitter.com/feenkcom/status/974420432240685062
> 
> - Looks: a mechanism for specifying element-specific composition and 
> interaction.
> 
> 
> GT
> 
> 
> - Documenter saw some major improvements. Just a reminder, Documenter is the 
> tool that enables live programming and previews directly within Pillar 
> documents.
> We now have a capability similar to notebooks like Jupyter:
> https://twitter.com/feenkcom/status/996310432225820672
> We use it extensively to document our code. For example, here is a tutorial 
> about playing with looks in Bloc:
> https://twitter.com/feenkcom/status/973899862482866176
> And we can also express whole tutorials based on Epicea:
> https://twitter.com/feenkcom/status/75333972541440
> 
> - Diagrammer. We now have better editing support for detailed things such as 
> arrow head:
> https://twitter.com/feenkcom/status/976341449267531776
> While Diagrammer is apparently a tool for diagrams, it has a rather generic 
> design that can be utilized for all sorts of use cases. For example, one side 
> effect is that now all elements can be visually edited:
> https://twitter.com/feenkcom/status/982656456968241152
> 
> - Mondrian: Using the new pannable element, we can now zoom in/out and 
> scroll, and we can also set element to fit screen. We can also drag elements 
> around.
> 
> - Inspector: we now have an initial support for multiple views associated 
> with an object. The support is similar to the one from the current inspector. 
> 
> 
> Have fun,
> The feenk team
> 
> --
> www.tudorgirba.com
> www.feenk.com
> 
> "What is more important: To be happy, or to make happy?"
> 
> 




Re: [Pharo-users] Macros?

2018-05-25 Thread Clément Bera
What about a preprocessor like the Java preprocessors ? The Truffle project
relies heavily on that for high performance Java and it's quite nice. It's
difficult to do that in Smalltalk right now.

I think if you want to do what are asking for you just need to write a
bytecode compiler extension.

I did something similar in the past to have precomputed constants through
AST manipulation at compilation time. You can find it here with examples:
http://smalltalkhub.com/#!/~ClementBera/NeoCompiler. Once the code is
loaded you need to recompile the examples (NeoCompilerExample
withAllSubclassesDo: #compileAll.). With it you can write code such as:
[ Smalltalk vm class ] Cvalue
And depending if the compiler allowsPrecompilation or not, the bytecode
compiler generates:
Smalltalk vm class
Or just a push literal with the precomputed value (the class VirtualMachine
).
In the end I decided not to use this, but you can use it and extend it to
support more than just constants (any AST manipulation is possible).
Just checked it works in Pharo 6.

On Fri, May 25, 2018 at 4:26 PM, Stephan Eggermont  wrote:

> Debiller 777 
> wrote:
> > Well, I've already asked about adding new literals to pharo or
> Smalltalk in
> > general, however this time I have a better idea:
> > macros. Can they be added? Because if I understand correctly they may be
> > the only way to do that.
>
> Why do you think they would be a good idea? We have powerful
> meta-programming facilities that are well understood and somewhat supported
> by tooling. How do we get value out of macros?
>
> Stephan
>
>
>
>


-- 
Clément Béra
https://clementbera.github.io/
https://clementbera.wordpress.com/


Re: [Pharo-users] Macros?

2018-05-25 Thread Ben Coman
On 25 May 2018 at 21:22, Debiller 777  wrote:

> Well, I've already asked about adding new literals to pharo or Smalltalk
> in general, however this time I have a better idea:
> macros. Can they be added? Because if I understand correctly they may be
> the only way to do that.
>

Can you provide an example how how you would use a macro?

cheers -ben


Re: [Pharo-users] Macros?

2018-05-25 Thread Stephan Eggermont
Debiller 777 
wrote:
> Well, I've already asked about adding new literals to pharo or
Smalltalk in
> general, however this time I have a better idea:
> macros. Can they be added? Because if I understand correctly they may be
> the only way to do that.

Why do you think they would be a good idea? We have powerful
meta-programming facilities that are well understood and somewhat supported
by tooling. How do we get value out of macros?

Stephan





Re: [Pharo-users] BlueInk Pretty Printer Array Formatting

2018-05-25 Thread Denis Kudriashov
Hi.

I think it should be default behaviour. So open issue, please.
​


[Pharo-users] Macros?

2018-05-25 Thread Debiller 777
Well, I've already asked about adding new literals to pharo or Smalltalk in
general, however this time I have a better idea:
macros. Can they be added? Because if I understand correctly they may be
the only way to do that.


Re: [Pharo-users] [Pharo-dev] feenk log

2018-05-25 Thread Denis Kudriashov
Hi Tudor.

Very impressive progress.
I have one question about scrolling support. How it works or is it works
with elements which are based on infinite layout like mentioned grid
widget?
Does grid implemented with PannableElement too?



2018-05-25 14:30 GMT+03:00 Tudor Girba :

> Hi,
>
> We were a bit silent the last couple of months. Quite a bit happened in
> the meantime, so here is a summary (for more fine grained announcements,
> you can follow us on Twitter):
>
> 
> Bloc
> 
>
> - Scrolling. We finally have a good scrolling support:
> https://twitter.com/feenkcom/status/991690465224331264
> This might sound like a trivial feature, but it turns out it is not. We
> had a bug that forced us to rethink the support quite deeply in order to be
> able to debug it. To do this, we now can simulate time in Bloc, which is
> really cool:
> https://twitter.com/feenkcom/status/989797367523233797
> https://twitter.com/feenkcom/status/988753142299938817
> (as a side note, the bug we fought with was the last
>
> - Pannable element is a combination of a scrollable element with a
> scalable element, and it offers the possibility either to zoom in/out +
> scroll, or to fit screen and resize when the parent resizes.
>
> - PDF, SVG, PNG, JPG export (based on the underlying Moz2D support):
> https://twitter.com/feenkcom/status/976580153802358786
> https://twitter.com/feenkcom/status/976578060429484032
>
> - Better curve support:
> https://twitter.com/feenkcom/status/990967109193781249
> https://twitter.com/feenkcom/status/990971530615107584
>
> - Better debugging support for understanding bounds:
> https://twitter.com/feenkcom/status/989138457288167424
>
> 
> Brick
> 
>
> - We now have simple list and columned list widgets. The list is both fast
> and scalable and supports rows of variable heights:
> https://twitter.com/feenkcom/status/984744251920658432
> https://twitter.com/feenkcom/status/984143821192744961
>
> - Basic tab widget:
> https://twitter.com/feenkcom/status/974420432240685062
>
> - Looks: a mechanism for specifying element-specific composition and
> interaction.
>
> 
> GT
> 
>
> - Documenter saw some major improvements. Just a reminder, Documenter is
> the tool that enables live programming and previews directly within Pillar
> documents.
> We now have a capability similar to notebooks like Jupyter:
> https://twitter.com/feenkcom/status/996310432225820672
> We use it extensively to document our code. For example, here is a
> tutorial about playing with looks in Bloc:
> https://twitter.com/feenkcom/status/973899862482866176
> And we can also express whole tutorials based on Epicea:
> https://twitter.com/feenkcom/status/75333972541440
>
> - Diagrammer. We now have better editing support for detailed things such
> as arrow head:
> https://twitter.com/feenkcom/status/976341449267531776
> While Diagrammer is apparently a tool for diagrams, it has a rather
> generic design that can be utilized for all sorts of use cases. For
> example, one side effect is that now all elements can be visually edited:
> https://twitter.com/feenkcom/status/982656456968241152
>
> - Mondrian: Using the new pannable element, we can now zoom in/out and
> scroll, and we can also set element to fit screen. We can also drag
> elements around.
>
> - Inspector: we now have an initial support for multiple views associated
> with an object. The support is similar to the one from the current
> inspector.
>
>
> Have fun,
> The feenk team
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "What is more important: To be happy, or to make happy?"
>
>
>


[Pharo-users] feenk log

2018-05-25 Thread Tudor Girba
Hi,

We were a bit silent the last couple of months. Quite a bit happened in the 
meantime, so here is a summary (for more fine grained announcements, you can 
follow us on Twitter):


Bloc


- Scrolling. We finally have a good scrolling support:
https://twitter.com/feenkcom/status/991690465224331264
This might sound like a trivial feature, but it turns out it is not. We had a 
bug that forced us to rethink the support quite deeply in order to be able to 
debug it. To do this, we now can simulate time in Bloc, which is really cool:
https://twitter.com/feenkcom/status/989797367523233797
https://twitter.com/feenkcom/status/988753142299938817
(as a side note, the bug we fought with was the last 

- Pannable element is a combination of a scrollable element with a scalable 
element, and it offers the possibility either to zoom in/out + scroll, or to 
fit screen and resize when the parent resizes.

- PDF, SVG, PNG, JPG export (based on the underlying Moz2D support):
https://twitter.com/feenkcom/status/976580153802358786
https://twitter.com/feenkcom/status/976578060429484032

- Better curve support:
https://twitter.com/feenkcom/status/990967109193781249
https://twitter.com/feenkcom/status/990971530615107584

- Better debugging support for understanding bounds:
https://twitter.com/feenkcom/status/989138457288167424


Brick


- We now have simple list and columned list widgets. The list is both fast and 
scalable and supports rows of variable heights:
https://twitter.com/feenkcom/status/984744251920658432
https://twitter.com/feenkcom/status/984143821192744961

- Basic tab widget:
https://twitter.com/feenkcom/status/974420432240685062

- Looks: a mechanism for specifying element-specific composition and 
interaction.


GT


- Documenter saw some major improvements. Just a reminder, Documenter is the 
tool that enables live programming and previews directly within Pillar 
documents.
We now have a capability similar to notebooks like Jupyter:
https://twitter.com/feenkcom/status/996310432225820672
We use it extensively to document our code. For example, here is a tutorial 
about playing with looks in Bloc:
https://twitter.com/feenkcom/status/973899862482866176
And we can also express whole tutorials based on Epicea:
https://twitter.com/feenkcom/status/75333972541440

- Diagrammer. We now have better editing support for detailed things such as 
arrow head:
https://twitter.com/feenkcom/status/976341449267531776
While Diagrammer is apparently a tool for diagrams, it has a rather generic 
design that can be utilized for all sorts of use cases. For example, one side 
effect is that now all elements can be visually edited:
https://twitter.com/feenkcom/status/982656456968241152

- Mondrian: Using the new pannable element, we can now zoom in/out and scroll, 
and we can also set element to fit screen. We can also drag elements around.

- Inspector: we now have an initial support for multiple views associated with 
an object. The support is similar to the one from the current inspector. 


Have fun,
The feenk team

--
www.tudorgirba.com
www.feenk.com

"What is more important: To be happy, or to make happy?"




Re: [Pharo-users] Set Rounding mode for IEEE floating point operations

2018-05-25 Thread Serge Stinckwich
On Thu, May 24, 2018 at 12:27 PM Steffen Märcker  wrote:

> Hi,
>
> now I've observed the same issue. It might be related to context
> switching, since introducing a delay has a similar effect. Consider:
>
>| FE_TONEAREST FE_DOWNWARD FE_UPWARD FE_TOWARDZERO |
>FE_TONEAREST  := 16r.
>FE_DOWNWARD   := 16r0400.
>FE_UPWARD := 16r0800.
>FE_TOWARDZERO := 16r0C00.
>"For some reasons we have to call fegetround once."
>"c := LibC new fegetround."
>LibC new fesetround: FE_DOWNWARD.
>(Delay forSeconds: 1) wait.
>v1 := 1.0/10.0.
>LibC new fesetround: FE_UPWARD.
>v2 := 1.0/10.0.
>LibC new fesetround: FE_TONEAREST.
>v1 < v2.
>
> If the delay is inserted, the script evaluates to false. Using the same
> LibC-instance or creating a new one does not seem to change anything
> here.
> Interestingly, a similar approach in VisualWorks does not show this issue
> yet.
>
>
​Ok, so maybe we need to use put evaluation in a block and use
valueNoContextSwitch ?
​Maybe use an API like the one you propose before :
Double roundToMinusInfWhile: [ ... ]



> Actually, I expect the FE_* macros to be platform/implementation
> dependent, as suggested here:
>
> http://www.enseignement.polytechnique.fr/informatique/INF478/docs/Cpp/en/c/numeric/fenv/FE_round.html
>
>
​Ok.

Can we try to pack everything in a PR for Pharo 7.0 ?
​Thank you.

-- 
Serge Stinckwich
UMI UMMISCO 209 (SU/IRD/UY1)
"Programs must be written for people to read, and only incidentally for
machines to execute."http://www.doesnotunderstand.org/


Re: [Pharo-users] pharo location include korean charactor then look is not good.

2018-05-25 Thread Sven Van Caekenberghe
I made the following quick changes:

UnixEnvironment>>#environAt: index
^ (self environ at: index) ifNotNil: [ :string | string asByteArray 
utf8Decoded ] 

OSPlatform>>#currentWorkingDirectoryPathWithBuffer: aByteString


^ (self getPwdViaFFI: aByteString size: aByteString size) 
ifNotNil: [ :string | string asByteArray utf8Decoded ]
ifNil:[ self error:'Insufficient buffer size to read current 
working directory: ' , aByteString size asString]

But actually almost any string coming from the VM seems wrong (i.e. should be 
further UTF-8 decoded):

SmalltalkImage>>#[prim]ImagePath

and #vmFileName basically probably every call 
VirtualMachine>>#getSystemAttribute:

what a mess ...

> On 25 May 2018, at 10:49, Sven Van Caekenberghe  wrote:
> 
> We looked at this before, but came to no conclusion.
> 
> The problem lies with OS environment variable decoding.
> 
> I created a 64-bit Pharo 7 in /tmp/été on macOS.
> 
> FileLocator imageDirectory resolve.
> "File @ /private/tmp/été"
> 
> Smalltalk os environment at: 'PWD'.
> "'/tmp/été'"
> 
> (Smalltalk os environment at: 'PWD') asByteArray utf8Decoded.
> "'/tmp/été'"
> 
> Smalltalk os environment asDictionary. 
> 
> FileBrowser works OK too but starts up with a wrong window title.
> 
> I believe the real issue is that we are not 100% sure that it is always UTF8 
> on all platforms all the time (i.e. apparently users can put their (Windows) 
> OS in a different encoding).
> 
>> On 25 May 2018, at 10:28, Hilaire  wrote:
>> 
>> I second you on this issue. Something went wrong in the encoding in the path 
>> in your window title. Ã smells like UTF-8 issue.
>> 
>> Looks like Pharo7 still has some issue(s) when handling UTF-8 characters 
>> used in modern Operating System filling system.
>> 
>> Another example of this problem, with DrGeo copied in a path with UTF-8 
>> characters, for example Été folder. When DrGeo is started, Pharo creates a 
>> folder Été where it creates some locale/ folder
>> 
>> I see this problem on ubtuntu 17.10 and Mac OSX at my school.
>> 
>> We have this problem for years, I was believing it was fixed, but apparently 
>> not.
>> 
>> Hilaire
>> 
>> 
>> Le 25/05/2018 à 04:09, peter yoo a écrit :
>>> so.. application location include korean charactor then broken title string 
>>> in pharo window.
>>> (of course ubuntu 18.04 with gnome env)
>>> 
>>> broken title is "바탕화면". it's ok? or where to report?
>>> 
>>> look a attached file please.
>>> 
>>> -- 
>> 
>> -- 
>> Dr. Geo
>> http://drgeo.eu
>> 
>> 
> 




Re: [Pharo-users] pharo location include korean charactor then look is not good.

2018-05-25 Thread Guillermo Polito
On Fri, May 25, 2018 at 10:49 AM, Sven Van Caekenberghe 
wrote:

> We looked at this before, but came to no conclusion.
>
> The problem lies with OS environment variable decoding.
>

I don't think that the window title comes from an OS env var.
This should be some encoding missing in the primitive (or the caller of the
primitive) that sets the window title or even a VM issue.


>
> I created a 64-bit Pharo 7 in /tmp/été on macOS.
>
> FileLocator imageDirectory resolve.
>  "File @ /private/tmp/été"
>
> Smalltalk os environment at: 'PWD'.
>  "'/tmp/été'"
>
> (Smalltalk os environment at: 'PWD') asByteArray utf8Decoded.
>  "'/tmp/été'"
>
> Smalltalk os environment asDictionary.
>
> FileBrowser works OK too but starts up with a wrong window title.
>
> I believe the real issue is that we are not 100% sure that it is always
> UTF8 on all platforms all the time (i.e. apparently users can put their
> (Windows) OS in a different encoding).
>

Well, not even. Because environment variables can have arbitrary data, in
whatever encoding.
IMHO, It's up to the user, the one that reads/write into PWD to
encode/decode it correctly.

We are in a sprint right now, I'm working with Asbath on some simple issues
so he learns the process.
I'll take a look at this in some minutes.


>
> > On 25 May 2018, at 10:28, Hilaire  wrote:
> >
> > I second you on this issue. Something went wrong in the encoding in the
> path in your window title. Ã smells like UTF-8 issue.
> >
> > Looks like Pharo7 still has some issue(s) when handling UTF-8 characters
> used in modern Operating System filling system.
> >
> > Another example of this problem, with DrGeo copied in a path with UTF-8
> characters, for example Été folder. When DrGeo is started, Pharo creates a
> folder Été where it creates some locale/ folder
> >
> > I see this problem on ubtuntu 17.10 and Mac OSX at my school.
> >
> > We have this problem for years, I was believing it was fixed, but
> apparently not.
> >
> > Hilaire
> >
> >
> > Le 25/05/2018 à 04:09, peter yoo a écrit :
> >> so.. application location include korean charactor then broken title
> string in pharo window.
> >> (of course ubuntu 18.04 with gnome env)
> >>
> >> broken title is "바탕화면". it's ok? or where to report?
> >>
> >> look a attached file please.
> >>
> >> --
> >
> > --
> > Dr. Geo
> > http://drgeo.eu
> >
> > 
>
>
>


-- 



Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - *http://www.cnrs.fr
*


*Web:* *http://guillep.github.io* 

*Phone: *+33 06 52 70 66 13


Re: [Pharo-users] pharo location include korean charactor then look is not good.

2018-05-25 Thread Sven Van Caekenberghe
We looked at this before, but came to no conclusion.

The problem lies with OS environment variable decoding.

I created a 64-bit Pharo 7 in /tmp/été on macOS.

FileLocator imageDirectory resolve.
 "File @ /private/tmp/été"

Smalltalk os environment at: 'PWD'.
 "'/tmp/été'"

(Smalltalk os environment at: 'PWD') asByteArray utf8Decoded.
 "'/tmp/été'"

Smalltalk os environment asDictionary. 

FileBrowser works OK too but starts up with a wrong window title.

I believe the real issue is that we are not 100% sure that it is always UTF8 on 
all platforms all the time (i.e. apparently users can put their (Windows) OS in 
a different encoding).

> On 25 May 2018, at 10:28, Hilaire  wrote:
> 
> I second you on this issue. Something went wrong in the encoding in the path 
> in your window title. Ã smells like UTF-8 issue.
> 
> Looks like Pharo7 still has some issue(s) when handling UTF-8 characters used 
> in modern Operating System filling system.
> 
> Another example of this problem, with DrGeo copied in a path with UTF-8 
> characters, for example Été folder. When DrGeo is started, Pharo creates a 
> folder Été where it creates some locale/ folder
> 
> I see this problem on ubtuntu 17.10 and Mac OSX at my school.
> 
> We have this problem for years, I was believing it was fixed, but apparently 
> not.
> 
> Hilaire
> 
> 
> Le 25/05/2018 à 04:09, peter yoo a écrit :
>> so.. application location include korean charactor then broken title string 
>> in pharo window.
>> (of course ubuntu 18.04 with gnome env)
>> 
>> broken title is "바탕화면". it's ok? or where to report?
>> 
>> look a attached file please.
>> 
>> -- 
> 
> -- 
> Dr. Geo
> http://drgeo.eu
> 
> 




Re: [Pharo-users] Code completion in Pharo?

2018-05-25 Thread Nicole de Graaf
Hi Andrzej,

my way of doing it:

Searching in the image what other guys are doing.

Finder: asMorph 

and here you can find methods like

#openAsMorph .. you can get a clue.

or:

‘some text’ asMorph inspect .. 
than you get the object and you can search the class and from here the class 
the references.

All my steps are based on code reading not code completion.

Code completion I use more if I know what is should be and use the same method 
names as the other developers.

Nic


> On 25 May 2018, at 03:12, andreo  wrote:
> 
> Dear Pharoers, 
> 
> I'm just starting out with Pharo 6.1, and I'm trying to use code completion
> to interactively explore various objects and their messages. However, I'm
> having difficulties doing this efficiently - I think I must be missing
> something obvious, and I hope you can point me in the right direction. 
> 
> For instance, let's say I have the below in Playground: 
> 
> 'some text' asMorph 
> 
> and I would like to display the morph object as a window, but I don't know
> the exact message name, or whether such a message exists at all. If I type
> "Window", then the completion popup will show a long list of matching
> messages, but won't show their documentation or argument names, so it will
> be difficult to know exactly what these messages do. 
> I can see that one can do "Do it and go" on an expression and then browse
> the available messages in Meta, but maybe there is simpler/faster way? 
> 
> How would an experienced Pharo user typically go about discovering the right
> messages in such situations? 
> 
> Best regards, 
> Andrzej
> 
> 
> 
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 



Re: [Pharo-users] Code completion in Pharo?

2018-05-25 Thread Tim Mackinnon

Hi - I’m slightly ahead of you on that journey - but what I do is press 
shift-enter which gives you a great tool called spotter that lets you explore 
more interactively.  In spotter if you also press cmd-p it will also preview 
method source too - so it’s close to what you are asking (and many methods have 
docs on their first line). However - selecting a method in spitter will also 
show you other senders of that method - some of those being test cases, which 
really give you insight into how to do most things. In fact this is a powerful 
element of Pharo that is often overlooked - as it’s written in itself, and all 
the source is there, there are excellent examples of how to do real things - 
even how the compiler and browsers work.

I mention the latter, as it occurs to me that in the code completion list, it 
would be nice to press shift-enter on the method you are contemplating and be 
able to spot on it (or maybe even the whole autocompletion list) - I think this 
would actually be quite doable (armed with a bit of system knowledge of 
course). This was something I missed when I first came across Smalltalk - I was 
frustrated it didn’t do X (that my pascal environment did at the time ), not 
realising that it was simply 3 lines of code I could easily add to the  
environment myself (and nowhere near as complicated or painful as writing 
plugins for eclipse or IntelliJ).

While at it - another nice trick, is to ctrl -shift click on any item in the 
environment and you get a little graphical halo appear - of which one icon is 
debug, which then let’s you inspect the code of that item (perhaps a button - 
which inevitably has an owner or a callback method you can then jump to and see 
the source of, and thus figure out how it works). It’s all very magical and 
dare I say fun... and this is why we love Smalltalk and Pharo , they are so 
malleable.

Tim 

Sent by iPhone



Sent from my iPhone
> On 25 May 2018, at 02:12, andreo  wrote:
> 
> Dear Pharoers, 
> 
> I'm just starting out with Pharo 6.1, and I'm trying to use code completion
> to interactively explore various objects and their messages. However, I'm
> having difficulties doing this efficiently - I think I must be missing
> something obvious, and I hope you can point me in the right direction. 
> 
> For instance, let's say I have the below in Playground: 
> 
> 'some text' asMorph 
> 
> and I would like to display the morph object as a window, but I don't know
> the exact message name, or whether such a message exists at all. If I type
> "Window", then the completion popup will show a long list of matching
> messages, but won't show their documentation or argument names, so it will
> be difficult to know exactly what these messages do. 
> I can see that one can do "Do it and go" on an expression and then browse
> the available messages in Meta, but maybe there is simpler/faster way? 
> 
> How would an experienced Pharo user typically go about discovering the right
> messages in such situations? 
> 
> Best regards, 
> Andrzej
> 
> 
> 
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> 




Re: [Pharo-users] pharo location include korean charactor then look is not good.

2018-05-25 Thread Hilaire
I second you on this issue. Something went wrong in the encoding in the 
path in your window title. Ã smells like UTF-8 issue.


Looks like Pharo7 still has some issue(s) when handling UTF-8 characters 
used in modern Operating System filling system.


Another example of this problem, with DrGeo copied in a path with UTF-8 
characters, for example Été folder. When DrGeo is started, Pharo creates 
a folder Été where it creates some locale/ folder


I see this problem on ubtuntu 17.10 and Mac OSX at my school.

We have this problem for years, I was believing it was fixed, but 
apparently not.


Hilaire


Le 25/05/2018 à 04:09, peter yoo a écrit :
so.. application location include korean charactor then broken title 
string in pharo window.

(of course ubuntu 18.04 with gnome env)

broken title is "바탕화면". it's ok? or where to report?

look a attached file please.

--


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