AppDevGuide error or just me?

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

AppDevGuide error or just me?

giorgiof
Hi, 
On the chapter about autoloading parcels, page 8.31 (VW7.9) I read:

Parcel loadParcelFrom: '..\parcels\UIPainter.pcl' 


This is not working on my OSX because it pretend the parcel on  a subdir of my developement image, not on a subdir of the  installation directory. I get back a file not found error.

It works if I do something like (I suppose there should be something better...)

name := LogicalFilename named: '$(VISUALWORKS)/parcels/UIPainter.pcl'.

Parcel loadParcelFrom: name asFilename .

It's on a brand new 7.9 image. Is something I'm missing or the doc is just still assuming the old way of having the dev images on a subtree of the installation dir?


ciao


giorgio



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: AppDevGuide error or just me?

Mark Roberts
Hi Giorgio,

My guess is that the example in the ADG does not work on OS X because the file path is expressed using $\, the Windows separator.

Your second example uses $/, so there is no problem on OS X. Note also that LogicalFilename class>>named: still requires that you use the same separator as expected by your current platform. I.e., it's not clear to me that #named: can handle what you are doing in a cross-platform fashion. There may be some issue with class LogicalFilename.

So, the ADG could be amended to say "For example, on Windows, the following line of code ...".

HTH,

M. Roberts
Cincom Systems, Inc.


On 10/14/2013 12:22 AM, giorgio ferraris wrote:
Hi, 
On the chapter about autoloading parcels, page 8.31 (VW7.9) I read:

Parcel loadParcelFrom: '..\parcels\UIPainter.pcl' 


This is not working on my OSX because it pretend the parcel on  a subdir of my developement image, not on a subdir of the  installation directory. I get back a file not found error.

It works if I do something like (I suppose there should be something better...)

name := LogicalFilename named: '$(VISUALWORKS)/parcels/UIPainter.pcl'.

Parcel loadParcelFrom: name asFilename .

It's on a brand new 7.9 image. Is something I'm missing or the doc is just still assuming the old way of having the dev images on a subtree of the installation dir?


ciao


giorgio




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: AppDevGuide error or just me?

Holger Kleinsorgen
to load the parcel on any OS, use "Filename fromComponents: ... "

Parcel loadParcelFrom: (Filename fromComponents: #('$(VISUALWORKS)' 'parcels' 'UIPainter.pcl'))

Mark D. Roberts wrote
      My guess is that the example in the ADG does not work on OS X
      because the file path is expressed using $\, the Windows
      separator.

[....]

      On 10/14/2013 12:22 AM, giorgio ferraris wrote:
   
   
      Hi, 
        On the chapter about autoloading parcels, page
          8.31 (VW7.9) I read:
                   
             
                Parcel
                    loadParcelFrom: '..\parcels\UIPainter.pcl' 
               
                 
                This is
                    not working on my OSX because it pretend the parcel
                    on  a subdir of my developement image, not on a
                    subdir of the  installation directory. I get back a
                    file not found error.
Reply | Threaded
Open this post in threaded view
|

Re: AppDevGuide error or just me?

giorgiof
In reply to this post by Mark Roberts
Hi, Mark, 

I should be sleeping, but before moving to the other way (that works only on OSX as I wrote it, you are correct, so I have to make more portable), I tried (almost) any possible combination of separators on the:
Parcel loadParcelFrom: '..\parcels\UIPainter.pcl' 
 starting from easiest: Parcel loadParcelFrom: '../parcels/UIPainter.pcl'  to ::parcels:UiPainter.. etc. 

I tested also on windows, and also there I got a file not found error using:  Parcel loadParcelFrom: '..\parcels\UIPainter.pcl' 
Included is the image of the initial stack. 
So, for me, it seems yet that that will work only if the development directory is under the installation directory, and it does not work now that the default is having the development directory into a different directory tree.
BTW: so the parcel path you define in settings does not helps when loading programmatically, right?

thanks

ciao

giorgio


BTW, Inline image 1 directory under the doc


On Mon, Oct 14, 2013 at 1:02 AM, Mark D. Roberts <[hidden email]> wrote:
Hi Giorgio,

My guess is that the example in the ADG does not work on OS X because the file path is expressed using $\, the Windows separator.

Your second example uses $/, so there is no problem on OS X. Note also that LogicalFilename class>>named: still requires that you use the same separator as expected by your current platform. I.e., it's not clear to me that #named: can handle what you are doing in a cross-platform fashion. There may be some issue with class LogicalFilename.

So, the ADG could be amended to say "For example, on Windows, the following line of code ...".

HTH,

M. Roberts
Cincom Systems, Inc.



On 10/14/2013 12:22 AM, giorgio ferraris wrote:
Hi, 
On the chapter about autoloading parcels, page 8.31 (VW7.9) I read:

Parcel loadParcelFrom: '..\parcels\UIPainter.pcl' 


This is not working on my OSX because it pretend the parcel on  a subdir of my developement image, not on a subdir of the  installation directory. I get back a file not found error.

It works if I do something like (I suppose there should be something better...)

name := LogicalFilename named: '$(VISUALWORKS)/parcels/UIPainter.pcl'.

Parcel loadParcelFrom: name asFilename .

It's on a brand new 7.9 image. Is something I'm missing or the doc is just still assuming the old way of having the dev images on a subtree of the installation dir?


ciao


giorgio




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: AppDevGuide error or just me?

Karsten Kusche
In reply to this post by Holger Kleinsorgen
You can also create paths using '$(VISUALWORKS)' asLogicalFileSpecification asFilename / 'parcels' / 'UIPainter.pcl'.
The #/ selector makes it quite readable and it's platform independent. Only challenge is to create the initial filename. Sometimes '.' asFilename is enough, sometimes you need to create the Filename from a LogicalFilename (both are not subclasses of the same class, which is quite annoying).

Kind Regards
Karsten



-- 
Karsten Kusche - Dipl. Inf. (FH) - [hidden email]
Georg Heeg eK - Köthen
Handelsregister: Amtsgericht Dortmund A 12812 

Am Montag, 14. Oktober 2013 um 10:50 schrieb Holger Kleinsorgen:

to load the parcel on any OS, use "Filename fromComponents: ... "

Parcel loadParcelFrom: (Filename fromComponents: #('$(VISUALWORKS)'
'parcels' 'UIPainter.pcl'))


Mark D. Roberts wrote
My guess is that the example in the ADG does not work on OS X
because the file path is expressed using $\, the Windows
separator.

[....]

On 10/14/2013 12:22 AM, giorgio ferraris wrote:
Hi,&nbsp;
On the chapter about autoloading parcels, page
8.31 (VW7.9) I read:
Parcel
loadParcelFrom: '..\parcels\UIPainter.pcl'&nbsp;
This is
not working on my OSX because it pretend the parcel
on &nbsp;a subdir of my developement image, not on a
subdir of the &nbsp;installation directory. I get back
a
file not found error.





--
Sent from the VisualWorks mailing list archive at Nabble.com.
_______________________________________________
vwnc mailing list


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: AppDevGuide error or just me?

giorgiof
Hi, 

thanks to all, your ways are shorter that the one I supposed to use.
Regarding the documentations, so it seems that that is wrong, right?

ciao

giorgio


On Mon, Oct 14, 2013 at 4:17 PM, Karsten Kusche <[hidden email]> wrote:
You can also create paths using '$(VISUALWORKS)' asLogicalFileSpecification asFilename / 'parcels' / 'UIPainter.pcl'.
The #/ selector makes it quite readable and it's platform independent. Only challenge is to create the initial filename. Sometimes '.' asFilename is enough, sometimes you need to create the Filename from a LogicalFilename (both are not subclasses of the same class, which is quite annoying).

Kind Regards
Karsten



-- 
Karsten Kusche - Dipl. Inf. (FH) - [hidden email]
Georg Heeg eK - Köthen
Handelsregister: Amtsgericht Dortmund A 12812 

Am Montag, 14. Oktober 2013 um 10:50 schrieb Holger Kleinsorgen:

to load the parcel on any OS, use "Filename fromComponents: ... "

Parcel loadParcelFrom: (Filename fromComponents: #('$(VISUALWORKS)'
'parcels' 'UIPainter.pcl'))


Mark D. Roberts wrote
My guess is that the example in the ADG does not work on OS X
because the file path is expressed using $\, the Windows
separator.

[....]

On 10/14/2013 12:22 AM, giorgio ferraris wrote:
Hi,&nbsp;
On the chapter about autoloading parcels, page
8.31 (VW7.9) I read:
Parcel
loadParcelFrom: '..\parcels\UIPainter.pcl'&nbsp;
This is
not working on my OSX because it pretend the parcel
on &nbsp;a subdir of my developement image, not on a
subdir of the &nbsp;installation directory. I get back
a
file not found error.





--
Sent from the VisualWorks mailing list archive at Nabble.com.
_______________________________________________
vwnc mailing list


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: AppDevGuide error or just me?

Mark Roberts
On 10/14/2013 11:35 PM, giorgio ferraris wrote:
Regarding the documentations, so it seems that that is wrong, right?

The code example in the documentation works when I execute it on a Windows machine. However, it assumes you will edit the separators for other platforms.

So, we have created AR 69046 to clarify the documentation and provide better information about platform-independent file names.

W.r.t. the exception stack you posted, I am not sure why you are seeing this on Windows. If you have all the directories in place as the VisualWorks installer proposes, the path should exist.

Best regards,

M. Roberts


On Mon, Oct 14, 2013 at 4:17 PM, Karsten Kusche <[hidden email]> wrote:
You can also create paths using '$(VISUALWORKS)' asLogicalFileSpecification asFilename / 'parcels' / 'UIPainter.pcl'.
The #/ selector makes it quite readable and it's platform independent. Only challenge is to create the initial filename. Sometimes '.' asFilename is enough, sometimes you need to create the Filename from a LogicalFilename (both are not subclasses of the same class, which is quite annoying).

Kind Regards
Karsten



-- 
Karsten Kusche - Dipl. Inf. (FH) - [hidden email]
Georg Heeg eK - Köthen
Handelsregister: Amtsgericht Dortmund A 12812 

Am Montag, 14. Oktober 2013 um 10:50 schrieb Holger Kleinsorgen:

to load the parcel on any OS, use "Filename fromComponents: ... "

Parcel loadParcelFrom: (Filename fromComponents: #('$(VISUALWORKS)'
'parcels' 'UIPainter.pcl'))


Mark D. Roberts wrote
My guess is that the example in the ADG does not work on OS X
because the file path is expressed using $\, the Windows
separator.

[....]

On 10/14/2013 12:22 AM, giorgio ferraris wrote:
Hi,&nbsp;
On the chapter about autoloading parcels, page
8.31 (VW7.9) I read:
Parcel
loadParcelFrom: '..\parcels\UIPainter.pcl'&nbsp;
This is
not working on my OSX because it pretend the parcel
on &nbsp;a subdir of my developement image, not on a
subdir of the &nbsp;installation directory. I get back
a
file not found error.





--
Sent from the VisualWorks mailing list archive at Nabble.com.
_______________________________________________
vwnc mailing list


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: AppDevGuide error or just me?

mkobetic
In reply to this post by giorgiof
"giorgio ferraris"<[hidden email]> wrote:
> BTW: so the parcel path you define in settings does not helps when loading
> programmatically, right?

It does help, but you need to use different API:

        Parcel ensureLoadedParcel: 'UIPainter' withVersion: nil

HTH,

Martin

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: AppDevGuide error or just me?

giorgiof
hi, Martin, 

sorry for late delay, but I just restarted over today. 
Thanks a lot, your suggestion is what I was looking for but unable to found. It solves all of the problems for loading standard parcels on a new image because it looks on the search path . Thanks.

For Mark, regarding the fact that I have the exception, i tried on windows and mac with brand new installation and got the error I sent. 
I'll try again as soon as possible eventually using a new version of VW and let you now

ciao and thanks to all for suggestions
giorgio


On Tue, Oct 15, 2013 at 12:04 AM, <[hidden email]> wrote:
"giorgio ferraris"<[hidden email]> wrote:
> BTW: so the parcel path you define in settings does not helps when loading
> programmatically, right?

It does help, but you need to use different API:

        Parcel ensureLoadedParcel: 'UIPainter' withVersion: nil

HTH,

Martin


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc