Great, you perfectly understood the CodeHolder!

 

Instance variables not present? Leave them undeclared. 

Since that code never runs in this image, it does no harm. It just fills your 
Undeclareds list.

 

Here is an example where I extend an existing class referencing a variable 
(#array) only available in the target dialect:



 

Happy hacking,

                Christian

 

 

Von: Steffen Märcker <merk...@web.de> 
Gesendet: Donnerstag, 13. April 2023 10:41
An: Any question about pharo is welcome <pharo-users@lists.pharo.org>
Betreff: [Pharo-users] Re: Porting from VW to Pharo

 

Hi Christian,

 

I am working slowly through the required changes. Thanks for your comprehensive 
answer. When I have made some more progress, I think having a call would be 
nice. I'll try loading the package again from store later today.

 

One quick question:

As far as I understand, to extend classes in the target dialect with methods 
that are not extended in the source project, I have to define a System class 
change like this:

 

                SystemClassChange

                               className: #Color

                               instanceChanges: (Array with: (Add method: 
#asColorValue code: #_ph_asColorValue)

 

The actual code for the extension has to be implemented in CodeHolder, correct? 
How do I deal then with methods that need to access instance variables not 
present in CodeHolder? Just add them to the class or is there another way?

 

Kind regards,

Steffen

 


Christian Haider schrieb am Mittwoch, 12. April 2023 21:07:05 (+02:00):

Hi Steffen,

 

thanks for trying and asking!

 

I was loading the code needed into a 8.3, 64bit virgin image and realized that 
loading is not that straight forward and described too briefly.

First, you need a non-default setting for the store prerequisites. I added this 
to the store access page:  <https://wiki.pdftalk.de/doku.php?id=storeaccess> 
https://wiki.pdftalk.de/doku.php?id=storeaccess . It is critical to load the 
prereqs from store and not from parcels!

 

The first thing to load is the bundle {Smalltalk Transform Project}.

To see examples you need to load the subject of transformation: PDFtalk.

You need to load to top bundle {PDFtalk Project} which includes the test 
classes you are missing in your image.

At last, load the [Pharo Fileout PDFtalk] package.

I improved the landing page  
<https://wiki.pdftalk.de/doku.php?id=smalltalktransform> 
https://wiki.pdftalk.de/doku.php?id=smalltalktransform a bit to make this 
clearer.

 

I just tried and this loads without errors or warnings.

 

(Actually good that the load did not work for you, because I added a mistake in 
January which causes a 8.3 image to crash when you open a browser. Sorry for 
that.)

 

Now you should be all set for generating a fileout of PDFtalk for Pharo (in the 
current unfinished state).

 

Thanks for spotting the problems with the documentation. I will get over it 
tomorrow.

I am quick in renaming and making structural changes when things are not 
working as I want… But the docs should be correct, of course.

 

 

About the project structure.

Currently, everything belonging to a project, need to be transformed in one go. 
This is not a big deal, because all code transformations are described on the 
package level and can be easily recombined as the bundle structure changes.

 

The last piece of the transformation puzzle is to make the transformations 
modular, so that the renamings of prerequisite packages can be used without the 
need to transform the prereqs as well. I hope to get at that soon…

In the meantime, I would start with your Core project to get a feel for the 
mechanics. I am sure the rest will fall nicely into its places.

 

About how to structure your code in Pharo with Git, I don’t know much about 
that. Actually, I would also be interested in some guidelines to bake them into 
the transformations…

 

If you are seriously interested, we could have an online session to hack around 
with it…

 

Cheers,

                Christian

 

 

Von: Steffen Märcker <merk...@web.de <mailto:merk...@web.de> > 
Gesendet: Dienstag, 11. April 2023 17:52
An: Any question about pharo is welcome < <mailto:pharo-users@lists.pharo.org> 
pharo-users@lists.pharo.org>
Betreff: [Pharo-users] Re: Porting from VW to Pharo

 

Dear Christian and Richard,

 

thanks for your answers. I'll try to go through the process step by step and 
come back with questions to the list if that's okay.

 

First, after loading the "Pharo Fileout PDFTalk", VW (8.3, 64 Bit) shows two 
unloadable definitions:

- PostscriptInterpreterTests>>_ph_testOperatorNotFound
- ColorValueTest>>_ph_testBridgedNamedColors

Both classes are not loaded

 

 

 

Second, it appears that some of the selectors mentioned on  
<https://wiki.pdftalk.de/doku.php?id=smalltalktransformdocumentation> 
https://wiki.pdftalk.de/doku.php?id=smalltalktransformdocumentation have been 
renamed, e.g., PackageChanges>>unusedClasses

 

More general, regarding project structure. What is the best approach to port a 
project that consists of multiple loosely coupled packages (not in a bundle) 
some of which being optional? Like

- Package Project Core

- Package Project Core Tests (requires Core)

- Package Project Extension A (requires Core)
- Package Project Extension A Tests (requires Extension A)

- Package Project Examples (requires Core and Extension A)

 

And how should I structure this on the Pharo site and in an iceberg repository? 
One Git repository per package or all in the same? Is there a guide to this or 
a specific Mooc lesson?

 

Kind regards,

Steffen

 

 


Christian Haider schrieb am Donnerstag, 6. April 2023 18:16:00 (+02:00):

Yes, PDFtalk is the only example, because it was created to port that library. 
Any other uses are welcome.

 

The project has been dormant for a year now because of other obligations, but I 
hope to resume soon.

 

The documentation is, as Richard notes, in a suboptimal state. I think that the 
information is still accurate.

Any help with this would be welcome, for example by asking questions or by 
criticizing concrete issues.

 

Christian

 

Von: Richard Sargent < <mailto:richard.sarg...@gemtalksystems.com> 
richard.sarg...@gemtalksystems.com> 
Gesendet: Donnerstag, 6. April 2023 17:55
An: Any question about pharo is welcome < <mailto:pharo-users@lists.pharo.org> 
pharo-users@lists.pharo.org>
Betreff: [Pharo-users] Re: Porting from VW to Pharo

 

The best(?) place to start is perhaps  
<https://wiki.pdftalk.de/doku.php?id=smalltalktransform> 
https://wiki.pdftalk.de/doku.php?id=smalltalktransform.

The only examples are various ports of PDFtalk (from VisualWorks) to Pharo, 
Squeak, GemStone, and VAST.

 

PDFtalk is quite complex and the porting rules are correspondingly complex. The 
Transform documentation does leave something to be desired.

 

On Thu, Apr 6, 2023 at 8:22 AM Steffen Märcker < <mailto:merk...@web.de> 
merk...@web.de> wrote:

Hi!

this topic pops up from time to time on the mailing list. I want to port a
number of packages to Pharo. I remember "Shaping" asking this for porting
PDFtalk.

1. Is the workflow still up to date or is there a new way of doing things?
2. From what I understand so far, I just need the following package from
Store:
- Smalltalk Transform Project
3.  Is there a page that documents the process process in general?
 <https://wiki.pdftalk.de/doku.php?id=setupvisualworks> 
https://wiki.pdftalk.de/doku.php?id=setupvisualworks seems to be specific
for PDFtalk like the thread on this list.

Kind regards,
Steffen


-- 
Gesendet mit Vivaldi Mail. Laden Sie Vivaldi kostenlos von vivaldi.com herunter.


-- 
Gesendet mit Vivaldi Mail. Laden Sie Vivaldi kostenlos von vivaldi.com herunter.

Reply via email to