Get the code of a method - Artefact

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Get the code of a method - Artefact

g_ongenae
Hello,

I'm a student at Lille 1 university, so I'm still a beginner in Pharo

I'm working on Artefact to create a more understable and complete demonstration.
To do that I would like to print the code of a given method. However I can find how to decompiled the given method.
Any help is welcome.

--
Reply | Threaded
Open this post in threaded view
|

Re: Get the code of a method - Artefact

Henrik Nergaard

( aClass >> #aSelector ) sourceCode.

 

Ex:

 

(Morph>>#drawOn:) sourceCode

 

For class side methods:

 

(Object class >> #taskbarIcon) sourceCode

 

Best regards,

Henrik

 

From: Pharo-users [mailto:[hidden email]] On Behalf Of Guillaume Ongenae
Sent: Thursday, March 10, 2016 11:14 AM
To: [hidden email]
Subject: [Pharo-users] Get the code of a method - Artefact

 

Hello,

 

I'm a student at Lille 1 university, so I'm still a beginner in Pharo

 

I'm working on Artefact to create a more understable and complete demonstration.

To do that I would like to print the code of a given method. However I can find how to decompiled the given method.

Any help is welcome.

 

--

 

Feil! Filnavn er ikke angitt.

Bilde er fjernet av sender.

 

Guillaume Ongenae

Feil! Filnavn er ikke angitt.about.me/guillaume.ongenae

Bilde er fjernet av sender.

 

Reply | Threaded
Open this post in threaded view
|

Re: Get the code of a method - Artefact

CyrilFerlicot
In reply to this post by g_ongenae
Hi,

Do you really need to decompile the method? A CompiledMethod know his source code.

See: Object methods first sourceCode

But you can get the decompiled code with:

Object methods first codeForNoSource

I hope this help you

On Thu, Mar 10, 2016 at 11:14 AM, Guillaume Ongenae <[hidden email]> wrote:
Hello,

I'm a student at Lille 1 university, so I'm still a beginner in Pharo

I'm working on Artefact to create a more understable and complete demonstration.
To do that I would like to print the code of a given method. However I can find how to decompiled the given method.
Any help is welcome.

--



--
Cheers
Cyril Ferlicot
Reply | Threaded
Open this post in threaded view
|

Re: Get the code of a method - Artefact

Clément Béra
sourceCode is the best way to do it. It answers the original sources if available, and the decompiled sources if not available.

2016-03-10 11:22 GMT+01:00 Cyril Ferlicot <[hidden email]>:
Hi,

Do you really need to decompile the method? A CompiledMethod know his source code.

See: Object methods first sourceCode

But you can get the decompiled code with:

Object methods first codeForNoSource

I hope this help you

On Thu, Mar 10, 2016 at 11:14 AM, Guillaume Ongenae <[hidden email]> wrote:
Hello,

I'm a student at Lille 1 university, so I'm still a beginner in Pharo

I'm working on Artefact to create a more understable and complete demonstration.
To do that I would like to print the code of a given method. However I can find how to decompiled the given method.
Any help is welcome.

--



--
Cheers
Cyril Ferlicot

Reply | Threaded
Open this post in threaded view
|

Re: Get the code of a method - Artefact

g_ongenae
Yes, sourceCode is what what I was looking for, but couldn't find.

Cyril Ferlicot, no, I don't need to decompile it, I was just thinking that it could be a solution. Anyway.
 
Thank you.

Cheers.
Guillaume
Reply | Threaded
Open this post in threaded view
|

Re: Get the code of a method - Artefact

Stephan Eggermont-3
In reply to this post by g_ongenae
On 10-03-16 11:14, Guillaume Ongenae wrote:
> Hello,
>
> I'm a student at Lille 1 university, so I'm still a beginner in Pharo
>
> I'm working on Artefact to create a more understable and complete
> demonstration.
>

Artefact the pdf library?

Stephan


Reply | Threaded
Open this post in threaded view
|

Re: Get the code of a method - Artefact

g_ongenae
Yes, Artefact the PDF Library.