Re: [Pharo-users] AST tokens question

2014-10-29 Thread Marcus Denker

> On 29 Oct 2014, at 16:27, Thierry Goubier  wrote:
> 
> 
> 
> 2014-10-29 16:17 GMT+01:00 Mark Rizun  >:
> You mean the changes tool in Monticello ?
> 
> No I mean, that before your rule is applied you will see the same window, 
> when you choose refactoring.
> I mean Changes Browser. Here it is:
> 
>  
> 
> Ok, thanks.
> 
> this is a gui I never ended up seeing, apart from dismissing it for obvious 
> refactorings when I was using OmniBrowser :( I think I got rid of it somehow 
> ;)
> 
> Hum, not convenient. 
> 
> Certainly doesn't invite me to do refactorings :(
> 

Yes… improvements are very welcome…

Marcus



Re: [Pharo-users] FFI structs

2014-10-29 Thread Thomas Bany
Oops, sorry, I was misslead by Steph reply.

Some of the comments might still hold. For the *time: ’05:45’* code to
work, you would need FFI to handle all the hassle of memory management and
actually allocate the memory for 5 characters and copying it. I never used
FFI but I doubt it does this.

Looking at FFI library, you both have ExternalAddress (for the struct with
char*) and ExternalType (for the struct with char[5]) that you can use. For
the later solution, it still looks like you should define a specific 5
bytes ArrayOf5Char type.

2014-10-29 18:34 GMT+01:00 Annick Fron :

> I can’t use NativeBoost on the Raspberry, I would be glad if I could !!!
>
>
> Le 29 oct. 2014 à 12:18, stepharo  a écrit :
>
> > did you read the NativeBoost tutorial on the PharoForTheEntreprise book?
> > If you do please report potential mistakes so that we can improve.
> >
> >
> > On 29/10/14 05:59, Annick Fron wrote:
> >> I I have a C struct with a char*
> >>
> >> struct result {
> >>  char* time }
> >>
> >> I define an ExternalStructure in FFI , with one field of type char*
> (note that the syntax char [5] is not accepted ! ).
> >>
> >> defineFields generates the accessors time and time:
> >>
> >> If I use
> >> time: ’05:45’
> >>
> >> I get an error.
> >> How do I set a string value in an ExternalStructure ?
> >>
> >> Annick
> >>
> >>
> >>
> >>
> >>
> >
> >
>
>
>


Re: [Pharo-users] [ANN] Pharo Days 2015

2014-10-29 Thread François Stephany
I can host one or two people at my place in Mons, Belgium (~1h drive from
INRIA Lille) for free. I can drive to the conference both days.

In the best case, I might have some friends to host me (us?) in Lille. So
we can have some beers without having to drive.

Francois


On Wed, Oct 29, 2014 at 4:18 PM, Sven Van Caekenberghe  wrote:

> We are excited to announce the details so far for the Pharo Days 2015, to
> be held on Thursday January 29 and Friday January 30 at INRIA, Lille,
> France.
>
>
>   https://medium.com/@svenvc/pharo-days-2015-6336d6ee2a23
>
>
> We’ll update this page moving forward. You can ask questions on the any of
> the Pharo mailing lists or you can email the Pharo Board.
>
>
> Official registration is not yet open, but there is a Doodle that should
> give an indication of who is coming and that can help us plan resources.
>
>
>   http://doodle.com/icxtazwfq76caxf8
>
>
> The Pharo Board
>


[Pharo-users] nautilus plugin documentation

2014-10-29 Thread Paul DeBruicker
Hi - 

Where is the content that was at this link:

http://rmod.inria.fr/web/pier/software/Tools-Improvement/NautilusDocumentation

?


Thanks

Paul


[Pharo-users] [ANN] Pharo Days 2015

2014-10-29 Thread Sven Van Caekenberghe
We are excited to announce the details so far for the Pharo Days 2015, to be 
held on Thursday January 29 and Friday January 30 at INRIA, Lille, France.


  https://medium.com/@svenvc/pharo-days-2015-6336d6ee2a23


We’ll update this page moving forward. You can ask questions on the any of the 
Pharo mailing lists or you can email the Pharo Board.


Official registration is not yet open, but there is a Doodle that should give 
an indication of who is coming and that can help us plan resources.


  http://doodle.com/icxtazwfq76caxf8


The Pharo Board


Re: [Pharo-users] Pharo - OpenDBXDriver: Unsupported data type: UNKNOWN

2014-10-29 Thread bsselfri...@gmail.com
Esteban and Guille, 

 I just realized that you gentlemen are the keepers of DBXTalk. Thank you
for kindly corresponding with me. My hat's off to all of you for taking on
this task. 

 I have a somewhat grandeur goal for solving this problem. I would like to
solve the problem rather than creating a work-around. I feel that the only
way for Smalltalk to make a comeback is if it and the supporting tools just
"work". If Pharo/GLORP supports MySql, then it should work, etc. etc - no
work arounds.  If the problem is in the OpenDBXDriver, then it would be nice
if this could be fixed (since I have NO C-lang experience there is little
that I can help with here) . If the problem is in OpenDBX libraries, then
our options are more limited. If we need to modify GLORP to define the types
in the mapping Descriptors and simply bypass the types provided by database
drivers, then I can help with that. 

I'm willing to help what I can. My personal goal is to build a GUI interface
for GLORP mapping. It would be nice to have this stuff working before I get
started. (If the drivers/mappers don't really work, then why build a GUI
mapping definition tool)? 

Thanks, 

Brad Selfridge
 





-
Brad Selfridge
--
View this message in context: 
http://forum.world.st/Pharo-OpenDBXDriver-Unsupported-data-type-UNKNOWN-tp4785813p4787493.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] FFI structs

2014-10-29 Thread Annick Fron
I can’t use NativeBoost on the Raspberry, I would be glad if I could !!!


Le 29 oct. 2014 à 12:18, stepharo  a écrit :

> did you read the NativeBoost tutorial on the PharoForTheEntreprise book?
> If you do please report potential mistakes so that we can improve.
> 
> 
> On 29/10/14 05:59, Annick Fron wrote:
>> I I have a C struct with a char*
>> 
>> struct result {
>>  char* time }
>> 
>> I define an ExternalStructure in FFI , with one field of type char* (note 
>> that the syntax char [5] is not accepted ! ).
>> 
>> defineFields generates the accessors time and time:
>> 
>> If I use
>> time: ’05:45’
>> 
>> I get an error.
>> How do I set a string value in an ExternalStructure ?
>> 
>> Annick
>> 
>> 
>> 
>> 
>> 
> 
> 




Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 16:17 GMT+01:00 Mark Rizun :

> You mean the changes tool in Monticello ?
>>
>
> No I mean, that before your rule is applied you will see the same window,
> when you choose refactoring.
> I mean Changes Browser. Here it is:
>
> [image: Вбудоване зображення 1]
>
> Ok, thanks.

this is a gui I never ended up seeing, apart from dismissing it for obvious
refactorings when I was using OmniBrowser :( I think I got rid of it
somehow ;)

Hum, not convenient.

Certainly doesn't invite me to do refactorings :(

Thierry


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Mark Rizun
>
> You mean the changes tool in Monticello ?
>

No I mean, that before your rule is applied you will see the same window,
when you choose refactoring.
I mean Changes Browser. Here it is:

[image: Вбудоване зображення 1]


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 15:54 GMT+01:00 Mark Rizun :

> This is the one which sounds difficult for me. Patterns are fairly global
>> in nature, and they may match synonyms (i.e. methods of the same name but
>> with different meanings), so I'm worried about the mastery of my changes.
>>
>> For an isNil ifTrue: to ifNil:, it's easy. But for an indexAt: to at:
>> because I'm changing an internal API, I'd like a better preview of what it
>> will affect before launching it (or a way to examine the resulting changes,
>> which is a bit convoluted).
>>
>
> You will see upcoming changes in Changes browser, so you can decide if
> it's what you really want.
>

You mean the changes tool in Monticello ?


> It's like applying refactoring.
>

Hum. Yes.

>
>
>
> I think this is already available, you just have to use it (or trigger it).
>>
>
> I'm not aware of this kind of things, can you specify where it is
> available?
>
>
> In that case, I would keep the old node, and simply try to find where is
>> the old node equal in the new ast when undoing (or when building the menu
>> to show that an undo is possible on that node).
>>
>
> That's pretty much the same what I'm doing.
>

Oh well, then you're done ;)

Thierry


>
> Mark
>


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Mark Rizun
>
> This is the one which sounds difficult for me. Patterns are fairly global
> in nature, and they may match synonyms (i.e. methods of the same name but
> with different meanings), so I'm worried about the mastery of my changes.
>
> For an isNil ifTrue: to ifNil:, it's easy. But for an indexAt: to at:
> because I'm changing an internal API, I'd like a better preview of what it
> will affect before launching it (or a way to examine the resulting changes,
> which is a bit convoluted).
>

You will see upcoming changes in Changes browser, so you can decide if it's
what you really want.
It's like applying refactoring.


I think this is already available, you just have to use it (or trigger it).
>

I'm not aware of this kind of things, can you specify where it is
available?


In that case, I would keep the old node, and simply try to find where is
> the old node equal in the new ast when undoing (or when building the menu
> to show that an undo is possible on that node).
>

That's pretty much the same what I'm doing.

Mark


Re: [Pharo-users] Zoomable & Infinitely scrollable PasteupMorph

2014-10-29 Thread Dennis Schetinin
Thanks, very interesting!


--

Best regards,


Dennis Schetinin

2014-10-29 16:31 GMT+04:00 Sean P. DeNigris :

> I gave up on zoomability (with the idea to revisit after Athens is
> integrated), but I hacked together an infinitely scrollable world, called
> ScrollableWorldMorph, which is in use in my LivingCode IDE prototype
> described (with loading instructions) at
>
> http://forum.world.st/Clickable-class-side-example-and-initialize-methods-in-Pharo-4-0-tp4785865p4786275.html
>
> If you have any questions about LivingCode specifically, the conversation
> was moved to
>
> http://forum.world.st/LivingCode-was-Clickable-class-side-example-and-initialize-methods-in-Pharo-4-0-td4786411.html#a4786522
>
> HTH
>
>
>
> -
> Cheers,
> Sean
> --
> View this message in context:
> http://forum.world.st/Zoomable-Infinitely-scrollable-PasteupMorph-tp4778229p4787434.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] FFI structs

2014-10-29 Thread Thomas Bany
Hi Annick !

I'll explain first why you got the error.

The assignment time: ’05:45’ failed because you tried to put an array of
char (of size 5*sizeof(char)) inside an address.

At some point, you need to allocate the memory that will hold the data. In
your case, you can do it quite easily with the class-side method
#fromString: of class NBExternalAdress. This will return a pointer, which
you can assign to the field of your struct.

Regarding what you really want to do, having a char[5] field in your
struct, I'm not totaly sure how you can do it with NativeBoost. A C struc
is just a chunk of memory with a well defined size, so if you want to
specify a field as a char[5], you must have a type that match that size. It
does not look like the field parser of NBExternalStruct can do it
dynamicaly. You could maybe hard code it by subclassing NBExternalType into
NBExternalArrayOf5Char, with a valueSize of 5.

As a final word, be wary of where you have allocated your objects, whether
it is in object-space (#new), or in C heap (#externalNew). The first is
garbage collected so the address are volatile, but you bare the duty of
freeing the memory in the second.

2014-10-29 12:18 GMT+01:00 stepharo :

> did you read the NativeBoost tutorial on the PharoForTheEntreprise book?
> If you do please report potential mistakes so that we can improve.
>
>
>
> On 29/10/14 05:59, Annick Fron wrote:
>
>> I I have a C struct with a char*
>>
>> struct result {
>> char* time }
>>
>> I define an ExternalStructure in FFI , with one field of type char* (note
>> that the syntax char [5] is not accepted ! ).
>>
>> defineFields generates the accessors time and time:
>>
>> If I use
>> time: ’05:45’
>>
>> I get an error.
>> How do I set a string value in an ExternalStructure ?
>>
>> Annick
>>
>>
>>
>>
>>
>>
>
>


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 11:41 GMT+01:00 Mark Rizun :

> I had a look at the video, and it looks great. Certainly the way to go.
>>
> Well, it's not that great. And it shows pretty old version of what I have
> now. I should make a new better one:)
>
>
>> I had some ideas along those, but I never have time to try them. My
>> interest would have been to show how many methods (and where:
>> group-package-tag-class?) the search pattern will impact.
>>
> In current version you can generate rule(it creates class for your rule),
> and than you can select packages/classes/methods you want to apply this rule
>

This is the one which sounds difficult for me. Patterns are fairly global
in nature, and they may match synonyms (i.e. methods of the same name but
with different meanings), so I'm worried about the mastery of my changes.

For an isNil ifTrue: to ifNil:, it's easy. But for an indexAt: to at:
because I'm changing an internal API, I'd like a better preview of what it
will affect before launching it (or a way to examine the resulting changes,
which is a bit convoluted).


>
>
>> One suggestion. When in the menu, try to auto-select the relevant keyword
>> or literal;
>>
> You mean in all other panes? It would be really cool
>

You're jumping ahead of my mind :) Yes, it would be cool (but not sure it
will be that easy to do in all cases; if you select @var1, would it
highlight myVariable in the other panes... hum, interesting to have).


>
>
>> give access to the ast navigation stuff (up select the enclosing ast
>> node, down the first node inside).
>>
> That's really great!  It'will take time, but I'm going to implement that,
> just have to remember:)
>

I think this is already available, you just have to use it (or trigger it).


>
>
> I think you can work recreating the ast. I'm not sure there is any reason
>> to keep track of old nodes, because what you do is: apply a change to ast
>> under selection; rebuilt RB matching / transform rule; apply RB rule to
>> sample code. update all four panes.
>>
>
> The process on video is: creating your own rule step by step. While doing
> this user may make a mistake.
> I keep oldNodes, because I want to have an "Undo on node" action. It
> returns node into it's previous state.
>

In that case, I would keep the old node, and simply try to find where is
the old node equal in the new ast when undoing (or when building the menu
to show that an undo is possible on that node).

Thierry


Re: [Pharo-users] **Important** PharoDays Preparation

2014-10-29 Thread Mark Rizun
Ok, I'm in:)

2014-10-29 13:10 GMT+02:00 stepharo :

>  fun and crazy conference with sprints and hacking in the middle.
> It will be super cool.
>
> Stef
>
>
> On 29/10/14 05:58, Mark Rizun wrote:
>
> Hi Stef, hi everyone!
>
>  As I plan to be in Lille during this time, I'm interested what is
> PharoDays conference?
>
>  Mark
>
>
> 2014-10-29 12:46 GMT+02:00 stepharo :
>
>> Hi guys
>>
>> We will organize at Lille the 29 and 30 of January PharoDays.
>> Now to help us building a budget I would like to know if you already know
>> that you plan to attend the conference.
>> Could you fill up the doodle
>>
>> http://doodle.com/icxtazwfq76caxf8
>>
>> Stef
>>
>>
>
>


Re: [Pharo-users] Zoomable & Infinitely scrollable PasteupMorph

2014-10-29 Thread Sean P. DeNigris
I gave up on zoomability (with the idea to revisit after Athens is
integrated), but I hacked together an infinitely scrollable world, called
ScrollableWorldMorph, which is in use in my LivingCode IDE prototype
described (with loading instructions) at
http://forum.world.st/Clickable-class-side-example-and-initialize-methods-in-Pharo-4-0-tp4785865p4786275.html

If you have any questions about LivingCode specifically, the conversation
was moved to
http://forum.world.st/LivingCode-was-Clickable-class-side-example-and-initialize-methods-in-Pharo-4-0-td4786411.html#a4786522

HTH



-
Cheers,
Sean
--
View this message in context: 
http://forum.world.st/Zoomable-Infinitely-scrollable-PasteupMorph-tp4778229p4787434.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] How not to serve an AngularJs application from Pharo

2014-10-29 Thread Attila Magyar
Also, there is a 

 serveStatic: '/statics' from: '/var/www/htdocs'

if someone wants to store something outside the image.




--
View this message in context: 
http://forum.world.st/How-not-to-serve-an-AngularJs-application-from-Pharo-tp4786980p4787433.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] BabyMock2: Stubbing individual methods from existing instance?

2014-10-29 Thread Sean P. DeNigris
Damien Pollet wrote
> (if it's not there, consider this an official feature request :)

We tried before
(http://forum.world.st/Unifying-Testing-Ideas-tp4726787p4727283.html) but he
wouldn't drink the partial stub koolaid ;)



-
Cheers,
Sean
--
View this message in context: 
http://forum.world.st/BabyMock2-Stubbing-individual-methods-from-existing-instance-tp4787228p4787432.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] BabyMock2: Stubbing individual methods from existing instance?

2014-10-29 Thread Damien Pollet
Well, I'm porting existing code with tests, so I would prefer to avoid
changing how they work.
Now I might as well consider it a rewrite…

On 28 October 2014 21:49, Attila Magyar  wrote:
> This is not supported. BabyMock is designed to test the message flow between
> objects, and not the internal implementation of an object. If the part what
> you want to stub out is not a private implementation detail then maybe
> extracting it to an object could help, otherwise couldn't you test the whole
> object?
>
>
>
> --
> View this message in context: 
> http://forum.world.st/BabyMock2-Stubbing-individual-methods-from-existing-instance-tp4787228p4787303.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>



Re: [Pharo-users] FFI structs

2014-10-29 Thread stepharo

did you read the NativeBoost tutorial on the PharoForTheEntreprise book?
If you do please report potential mistakes so that we can improve.


On 29/10/14 05:59, Annick Fron wrote:

I I have a C struct with a char*

struct result {
char* time }

I define an ExternalStructure in FFI , with one field of type char* (note that 
the syntax char [5] is not accepted ! ).

defineFields generates the accessors time and time:

If I use
time: ’05:45’

I get an error.
How do I set a string value in an ExternalStructure ?

Annick










Re: [Pharo-users] **Important** PharoDays Preparation

2014-10-29 Thread stepharo

fun and crazy conference with sprints and hacking in the middle.
It will be super cool.

Stef

On 29/10/14 05:58, Mark Rizun wrote:

Hi Stef, hi everyone!

As I plan to be in Lille during this time, I'm interested what is 
PharoDays conference?


Mark


2014-10-29 12:46 GMT+02:00 stepharo >:


Hi guys

We will organize at Lille the 29 and 30 of January PharoDays.
Now to help us building a budget I would like to know if you
already know that you plan to attend the conference.
Could you fill up the doodle

http://doodle.com/icxtazwfq76caxf8

Stef






Re: [Pharo-users] Zoomable & Infinitely scrollable PasteupMorph

2014-10-29 Thread Dennis Schetinin
Sean, any news on the topic?


--

Best regards,


Dennis Schetinin

2014-09-18 9:20 GMT+04:00 Alexandre Bergel :

> > Ah one thing with roassal:
> >
> > Please honor the global keymappings and morph local ones.
> >
> > TRMorph swallows them due to the key press related methods which hijack
> them all.
>
> Is there another keystroke than cmd-w ?
>
> > Once a TRMorph is active is feels weird.
> >
> > I love TRMorph and animations. Very nice code.
>
> Thanks!
>
> Alexandre
>
> >
> >
> >
> > Le 18 sept. 2014 05:46, "Alexandre Bergel"  a
> écrit :
> > Yes it can. But Roassal is not made to replace Morphic.
> > In my opinion, Morphic is not simply about having graphic elements
> answering events, as Roassal does. Morphic provides ways to build
> sophisticated UI (even if Morphic behaves poorly in comparison with
> state-of-the-art UI frameworks). Roassal is made to visualize and interact
> with data.
> >
> > As it is defined today, Roassal is not made to build sophisticated UI.
> >
> > Cheers,
> > Alexandre
> >
> >
> > On Sep 16, 2014, at 10:30 AM, Denis Kudriashov 
> wrote:
> >
> > > Do you think Roassal can replace Morphic at all?
> > >
> >
> > --
> > _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> > Alexandre Bergel  http://www.bergel.eu
> > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
> >
> >
> >
> >
> >
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>


Re: [Pharo-users] **Important** PharoDays Preparation

2014-10-29 Thread Mark Rizun
Hi Stef, hi everyone!

As I plan to be in Lille during this time, I'm interested what is PharoDays
conference?

Mark


2014-10-29 12:46 GMT+02:00 stepharo :

> Hi guys
>
> We will organize at Lille the 29 and 30 of January PharoDays.
> Now to help us building a budget I would like to know if you already know
> that you plan to attend the conference.
> Could you fill up the doodle
>
> http://doodle.com/icxtazwfq76caxf8
>
> Stef
>
>


[Pharo-users] **Important** PharoDays Preparation

2014-10-29 Thread stepharo

Hi guys

We will organize at Lille the 29 and 30 of January PharoDays.
Now to help us building a budget I would like to know if you already 
know that you plan to attend the conference.

Could you fill up the doodle

http://doodle.com/icxtazwfq76caxf8

Stef



Re: [Pharo-users] AST tokens question

2014-10-29 Thread Mark Rizun
>
> I had a look at the video, and it looks great. Certainly the way to go.
>
Well, it's not that great. And it shows pretty old version of what I have
now. I should make a new better one:)


> I had some ideas along those, but I never have time to try them. My
> interest would have been to show how many methods (and where:
> group-package-tag-class?) the search pattern will impact.
>
In current version you can generate rule(it creates class for your rule),
and than you can select packages/classes/methods you want to apply this rule


> One suggestion. When in the menu, try to auto-select the relevant keyword
> or literal;
>
You mean in all other panes? It would be really cool


> give access to the ast navigation stuff (up select the enclosing ast node,
> down the first node inside).
>
That's really great!  It'will take time, but I'm going to implement that,
just have to remember:)


I think you can work recreating the ast. I'm not sure there is any reason
> to keep track of old nodes, because what you do is: apply a change to ast
> under selection; rebuilt RB matching / transform rule; apply RB rule to
> sample code. update all four panes.
>

The process on video is: creating your own rule step by step. While doing
this user may make a mistake.
I keep oldNodes, because I want to have an "Undo on node" action. It
returns node into it's previous state.


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 11:16 GMT+01:00 Mark Rizun :

> I misunderstood you, of course I can find the node in old ast which was
> replaced, using operator =.
> Sure it works, but the problem is I have to pass oldNodes each time from
> old node to new one.
>

I think you can work recreating the ast. I'm not sure there is any reason
to keep track of old nodes, because what you do is: apply a change to ast
under selection; rebuilt RB matching / transform rule; apply RB rule to
sample code. update all four panes.

Thierry


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 11:11 GMT+01:00 Mark Rizun :

> This is well how I understood it.
>>
>> Are you implementing something around the use of refactoring?
>>
>
> I'm implementing tool for creating rewrite rules.  Here is a blog about
> it: http://myfuncoding.blogspot.com/
> Also I write chapter for PharoForEnterprise:
> https://github.com/SquareBracketAssociates/PharoForTheEnterprise-english/tree/master/RewriteTool
>
>
I had a look at the video, and it looks great. Certainly the way to go.

I had some ideas along those, but I never have time to try them. My
interest would have been to show how many methods (and where:
group-package-tag-class?) the search pattern will impact.

One suggestion. When in the menu, try to auto-select the relevant keyword
or literal; give access to the ast navigation stuff (up select the
enclosing ast node, down the first node inside).

Thierry


>
>
>> Keep us updated on your solution. It is significant because the equality
>> between ast nodes is part of the SmaCC parser generator toolkit, so any
>> solution on that may also be used when manipulating non-smalltalk code (C,
>> Java, C#, Python, R, Ada, etc...).
>>
>
> Sure, I will.
>


Re: [Pharo-users] How not to serve an AngularJs application from Pharo

2014-10-29 Thread Stephan Eggermont
Kilon wrote:
>would it not be better to have the html / css and js code outside the image ? 
>so instead to load files instead of return strings ? 

Only for the things that are really static. All other parts should be in the 
image, and be generated,
just like the seaside canvas does for html. Working with files just kills my 
productivity, especially if I have
to switch out of Pharo. 

For deployment, you can generate files, but then you don't serve them with 
Pharo. 

Of course, if you start out with files like in this example, it takes some time 
to refactor 
towards a sensible model.

Stephan


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Mark Rizun
P.S. Moreover, it's not only that I have to pass oldNodes each time from
old node to new one.
Each time I replace node I reparse tree and I lose oldNodes from each node
of ast:)
So, I have to pass oldNodes from each node of ast to each coresponding node
of new ast. And it's a real problem.


2014-10-29 12:16 GMT+02:00 Mark Rizun :

> I misunderstood you, of course I can find the node in old ast which was
> replaced, using operator =.
> Sure it works, but the problem is I have to pass oldNodes each time from
> old node to new one.
>


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Mark Rizun
I misunderstood you, of course I can find the node in old ast which was
replaced, using operator =.
Sure it works, but the problem is I have to pass oldNodes each time from
old node to new one.


Re: [Pharo-users] AST tokens question

2014-10-29 Thread stepharo

Thanks thierry and mark for this interesting discussion!

Stef

On 27/10/14 13:36, Mark Rizun wrote:

Hi all,

Trying to understand here how tokens are used in AST.
So far I can not see any order in usage of tokens.
For instance, why RBValueNode doesn't have token? Is it haow it's 
supposed to be?


Cheers,
Mark





Re: [Pharo-users] AST tokens question

2014-10-29 Thread Mark Rizun
>
> This is well how I understood it.
>
> Are you implementing something around the use of refactoring?
>

I'm implementing tool for creating rewrite rules.  Here is a blog about it:
http://myfuncoding.blogspot.com/
Also I write chapter for PharoForEnterprise:
https://github.com/SquareBracketAssociates/PharoForTheEnterprise-english/tree/master/RewriteTool



> Keep us updated on your solution. It is significant because the equality
> between ast nodes is part of the SmaCC parser generator toolkit, so any
> solution on that may also be used when manipulating non-smalltalk code (C,
> Java, C#, Python, R, Ada, etc...).
>

Sure, I will.


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 10:44 GMT+01:00 Mark Rizun :

>
>
> 2014-10-29 11:40 GMT+02:00 Thierry Goubier :
>
>>
>>
>> 2014-10-29 10:22 GMT+01:00 Mark Rizun :
>>
>>> Second one, I do replace node all the time.
>>>
>>
>> You insert new code inside the text view?
>>
>
> Yes
>
>
>>
>> For me, if you replace nodes and display that, then you are "slowly"
>> replacing nodes. Anything which has some display to a user in the loop is
>> "slow".
>>
> I'm not doing this in loop. I have AST and text view of it. Than I do one
> replace and update text view.
> When I wrote "all the time", I ment replacing nodes is very important in
> my tool, as it does main functionality.
>

This is well how I understood it.

Are you implementing something around the use of refactoring?


>
>
>>
>>
>>> Thinking a bit about it, I'd try reparse, get node from selection index,
 find equal old node in old (modified) ast, or replace old (modified) ast
 with new one.

>>> Can you explain this, sorry I didn't get the point
>>>
>>
>> Use either =, equalTo:withMapping:, match:inContext: to find the relevant
>> new node equal to your old node in the new ast.
>>
> Good, thanks for advice. Firstly, I will check your suggestion with
> equality. If it fails for me, I'll try my suggestion with calculating
> inside tool.
>

Keep us updated on your solution. It is significant because the equality
between ast nodes is part of the SmaCC parser generator toolkit, so any
solution on that may also be used when manipulating non-smalltalk code (C,
Java, C#, Python, R, Ada, etc...).

Thierry


>
> Thanks again,
> Mark
>
>


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Mark Rizun
2014-10-29 11:40 GMT+02:00 Thierry Goubier :

>
>
> 2014-10-29 10:22 GMT+01:00 Mark Rizun :
>
>> Second one, I do replace node all the time.
>>
>
> You insert new code inside the text view?
>

Yes


>
> For me, if you replace nodes and display that, then you are "slowly"
> replacing nodes. Anything which has some display to a user in the loop is
> "slow".
>
I'm not doing this in loop. I have AST and text view of it. Than I do one
replace and update text view.
When I wrote "all the time", I ment replacing nodes is very important in my
tool, as it does main functionality.


>
>
>> Thinking a bit about it, I'd try reparse, get node from selection index,
>>> find equal old node in old (modified) ast, or replace old (modified) ast
>>> with new one.
>>>
>> Can you explain this, sorry I didn't get the point
>>
>
> Use either =, equalTo:withMapping:, match:inContext: to find the relevant
> new node equal to your old node in the new ast.
>
Good, thanks for advice. Firstly, I will check your suggestion with
equality. If it fails for me, I'll try my suggestion with calculating
inside tool.

Thanks again,
Mark


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 10:22 GMT+01:00 Mark Rizun :

> Second one, I do replace node all the time.
>

You insert new code inside the text view?

For me, if you replace nodes and display that, then you are "slowly"
replacing nodes. Anything which has some display to a user in the loop is
"slow".


> Thinking a bit about it, I'd try reparse, get node from selection index,
>> find equal old node in old (modified) ast, or replace old (modified) ast
>> with new one.
>>
> Can you explain this, sorry I didn't get the point
>

Use either =, equalTo:withMapping:, match:inContext: to find the relevant
new node equal to your old node in the new ast.

Thierry


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 10:09 GMT+01:00 Mark Rizun :

> P.S. I have a solution, but don't know if it's appropriate: I remove
> updating of source interval from replaceWith: method, but my tool will do
> all the calculations of interval on it's own.
>

This is a possibility: have a transform; when you get selection intervals,
look if they are inside "replaced areas" or outside of it; increase or
decrease the indexes to compensate for added code / removed code. But this
is more complex than it looks.

But I would try the equality over an AST first. A lot more robust for me.

Thierry


>
> 2014-10-29 10:59 GMT+02:00 Mark Rizun :
>
>> That is way I'd like to have automatically updated source interval.

>>>
>>> I'm still not entirely sure why. Source intervals are only there to help
>>> relating the ast to the source, not much else, really.
>>>
>>
>> I use source intervals to detect which node is selected and than in the
>> right-click menu user can see only options that are relevanto to selected
>> node, as it is also made in SmartSuggestions.
>>
>
>


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Mark Rizun
Second one, I do replace node all the time.

Thinking a bit about it, I'd try reparse, get node from selection index,
> find equal old node in old (modified) ast, or replace old (modified) ast
> with new one.
>
Can you explain this, sorry I didn't get the point


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 9:59 GMT+01:00 Mark Rizun :

>
> I use source intervals to detect which node is selected and than in the
> right-click menu user can see only options that are relevanto to selected
> node, as it is also made in SmartSuggestions.
>

I know that use case ;)

Ok, then this means you are regenerating the code (1) (or are you doing
replace a node / insert new source at right place? (2))

Thinking a bit about it, I'd try reparse, get node from selection index,
find equal old node in old (modified) ast, or replace old (modified) ast
with new one.

Thierry


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Mark Rizun
P.S. I have a solution, but don't know if it's appropriate: I remove
updating of source interval from replaceWith: method, but my tool will do
all the calculations of interval on it's own.

2014-10-29 10:59 GMT+02:00 Mark Rizun :

> That is way I'd like to have automatically updated source interval.
>>>
>>
>> I'm still not entirely sure why. Source intervals are only there to help
>> relating the ast to the source, not much else, really.
>>
>
> I use source intervals to detect which node is selected and than in the
> right-click menu user can see only options that are relevanto to selected
> node, as it is also made in SmartSuggestions.
>


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Mark Rizun
>
> That is way I'd like to have automatically updated source interval.
>>
>
> I'm still not entirely sure why. Source intervals are only there to help
> relating the ast to the source, not much else, really.
>

I use source intervals to detect which node is selected and than in the
right-click menu user can see only options that are relevanto to selected
node, as it is also made in SmartSuggestions.


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 8:32 GMT+01:00 Mark Rizun :

>
> Which ones?
>
>
> In my tool each node has property oldNodes, which holds collection of
> obviously AST nodes:)
> When I replace one of node I have to update source interval in some way.
>


> 1)If I update it with reparsing, I loose all data about oldNodes for each
> node of my AST.
> So I have to save old AST with all oldNodes, and somehow detect which
> nodes were not changed and reassign their lost oldNodes.
> But sometimes it's difficult to detect where and what you have to assign,
> as sometimes AST may be changed in dramatic way.
>

Ok; yes, I can relate to that.

But, knowing who has designed the RB ast, I'm sure it has a proper equality
property where:

oldNodeFromAST = sameNodeFromASTreparsed

holds true.

So you can reparse and rematch old node to new node.

But I would only regenerate and reparse when I need to update the source
intervals (or display the modified source).


> 2) But if source interval is updated automatically I don't bother with
> losing data for all AST.
> I just have to update oldNodes for node that was replaced.
>

Well, not really.

If during regeneration of your source, you change the way the code is
formatted (more tabs here, removing a return there, etc...) then
regenerated source intervals are different from modified ast source
intervals. So your 'modify source intervals' is very fragile for me.

The only way I can see a way out for that problem:

Inserted / replaced node have source intervals in a separate source;
unmodified nodes keep their source interval. This is the way I do it in my
source to source compilers when I want to inject code (and tag in the
generated file where that code comes from: usefull for debugging).

Or the match of old node to new node as seen above.


>
> That is way I'd like to have automatically updated source interval.
>

I'm still not entirely sure why. Source intervals are only there to help
relating the ast to the source, not much else, really.

Thierry


>
>
>>
>> No it shouldn't. If the source has not been regenerated from the modified
>> AST, then
>>
>> 'source copyFrom: theBarASTNode start to: theBarASTNode stop'
>>
>> end past the end of it (20 to 23 with source ending at 19).
>>
>> If you regenerate the source, then you can parse it and you'll have
>> correct intervals.
>>
>
> Marcus, do I have to redo everything back, or you can somehow remove that
> slice from newest version?
>
> Mark
>
>
>


Re: [Pharo-users] How not to serve an AngularJs application from Pharo

2014-10-29 Thread kilon alios
oh brilliant, I really like this design very much. Definitely will look a
bit deeper into this .

I guess it makes sense to pass the source files as string when the web app
is finished to speed up loading times.

I really like this workflow for creating web apps. Well done guys.

On Wed, Oct 29, 2014 at 9:31 AM, S Krish 
wrote:

>
> "would it not be better to have the html / css and js code outside the
> image ? so instead to load files instead of return strings ? "
>
> *GET: '/index.html' -> [ self openspaceHtml ];  *
>
> can be modified to:
>
> *GET: '/index.html' -> [ self  fetch: 'html/openspace.html' ];  *
>
> and the *fetch:* method can be coded to return the file statically
> stored..   ( increase efficiency by using a cache with change detection on
> say filesize / timestamp )
>
>
>
> On Tue, Oct 28, 2014 at 1:51 AM, kilon alios 
> wrote:
>
>> would it not be better to have the html / css and js code outside the
>> image ? so instead to load files instead of return strings ?
>>
>> this would make it easier to edit the code for html/css/js . GT js
>> integration no idea how that works, does GT has for example syntax
>> highlighting or other js specific features ?
>>
>> Even though I always have been a supporter of Amber the IDE has still a
>> very long way to go. Dont know about Seaside, but I assume for Seaside js
>> code will still be something foreign. I think in practice would be better
>> to use the IDE tools offered by firefox and chrome, though its still
>> possible to use both amber and these tools, amber does not produce readable
>> js code. No clue about React and SqueakJS. I am very new to web dev so
>> probably I miss a lot, but frankly I found the fragmentation so shocking
>> and so many negative opinions about the whole workflow that I have been
>> reluctant to invest as much time as I have invested in Pharo. But then the
>> things I do are not so web orientated as other people. But still I am very
>> interested into this.
>>
>> SqueakJS looks definitely  very interesting.
>>
>> On Mon, Oct 27, 2014 at 10:05 PM, Stephan Eggermont 
>> wrote:
>>
>>> Kilon wrote
>>> >Really nice I now see the teapot stuff, for example this
>>> >
>>> >GET: 'demo/common/style.css' -> [ self styleCss ];
>>> >
>>> >is really flexible meaning you can interpret http addresses and map
>>> them to pharo methods. This a really cool idea indeed, I see now why people
>>> are excited about teapot. Excuse my ignorance about web >development but
>>> html/css and js always scared me away :D
>>>
>>> I found it a very easy way to get some existing javascript app delivered
>>> fast from Pharo.
>>> It needs a lot of refactoring and cleaning up to become maintainable
>>> though. Separate classes
>>> for the angular components, and the canvas from Seaside to structure the
>>> html.
>>>
>>> A more difficult aspect is how to create the javascript. For
>>> (qc)magritte applications it
>>> looks like a builder should be able to generate form components and a
>>> json data binding.
>>> With GT it should even be possible to integrate javascript development
>>> directly in the
>>> pharo image.
>>>
>>> And it might be better to use React or Amber or SqueakJS
>>>
>>> Stephan
>>>
>>
>>
>


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Mark Rizun
> Which ones?


In my tool each node has property oldNodes, which holds collection of
obviously AST nodes:)
When I replace one of node I have to update source interval in some way.
1)If I update it with reparsing, I loose all data about oldNodes for each
node of my AST.
So I have to save old AST with all oldNodes, and somehow detect which nodes
were not changed and reassign their lost oldNodes.
But sometimes it's difficult to detect where and what you have to assign,
as sometimes AST may be changed in dramatic way.
2) But if source interval is updated automatically I don't bother with
losing data for all AST.
I just have to update oldNodes for node that was replaced.

That is way I'd like to have automatically updated source interval.


>
> No it shouldn't. If the source has not been regenerated from the modified
> AST, then
>
> 'source copyFrom: theBarASTNode start to: theBarASTNode stop'
>
> end past the end of it (20 to 23 with source ending at 19).
>
> If you regenerate the source, then you can parse it and you'll have
> correct intervals.
>

Marcus, do I have to redo everything back, or you can somehow remove that
slice from newest version?

Mark


Re: [Pharo-users] How not to serve an AngularJs application from Pharo

2014-10-29 Thread S Krish
"would it not be better to have the html / css and js code outside the
image ? so instead to load files instead of return strings ? "

*GET: '/index.html' -> [ self openspaceHtml ];  *

can be modified to:

*GET: '/index.html' -> [ self  fetch: 'html/openspace.html' ];  *

and the *fetch:* method can be coded to return the file statically
stored..   ( increase efficiency by using a cache with change detection on
say filesize / timestamp )



On Tue, Oct 28, 2014 at 1:51 AM, kilon alios  wrote:

> would it not be better to have the html / css and js code outside the
> image ? so instead to load files instead of return strings ?
>
> this would make it easier to edit the code for html/css/js . GT js
> integration no idea how that works, does GT has for example syntax
> highlighting or other js specific features ?
>
> Even though I always have been a supporter of Amber the IDE has still a
> very long way to go. Dont know about Seaside, but I assume for Seaside js
> code will still be something foreign. I think in practice would be better
> to use the IDE tools offered by firefox and chrome, though its still
> possible to use both amber and these tools, amber does not produce readable
> js code. No clue about React and SqueakJS. I am very new to web dev so
> probably I miss a lot, but frankly I found the fragmentation so shocking
> and so many negative opinions about the whole workflow that I have been
> reluctant to invest as much time as I have invested in Pharo. But then the
> things I do are not so web orientated as other people. But still I am very
> interested into this.
>
> SqueakJS looks definitely  very interesting.
>
> On Mon, Oct 27, 2014 at 10:05 PM, Stephan Eggermont 
> wrote:
>
>> Kilon wrote
>> >Really nice I now see the teapot stuff, for example this
>> >
>> >GET: 'demo/common/style.css' -> [ self styleCss ];
>> >
>> >is really flexible meaning you can interpret http addresses and map them
>> to pharo methods. This a really cool idea indeed, I see now why people are
>> excited about teapot. Excuse my ignorance about web >development but
>> html/css and js always scared me away :D
>>
>> I found it a very easy way to get some existing javascript app delivered
>> fast from Pharo.
>> It needs a lot of refactoring and cleaning up to become maintainable
>> though. Separate classes
>> for the angular components, and the canvas from Seaside to structure the
>> html.
>>
>> A more difficult aspect is how to create the javascript. For (qc)magritte
>> applications it
>> looks like a builder should be able to generate form components and a
>> json data binding.
>> With GT it should even be possible to integrate javascript development
>> directly in the
>> pharo image.
>>
>> And it might be better to use React or Amber or SqueakJS
>>
>> Stephan
>>
>
>