Problem with vmmaker-dtl.211.mcz

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

Problem with vmmaker-dtl.211.mcz

CdAB63
Problem:

saveConfig
    "write info about the current configuration to a file."

    (UIManager default request: 'Save VMMaker configuration...' initialAnswer: self configFileName)
        ifNotNilDo: [:file | | path |
            ('*.config' match: file)
                ifFalse: [Cannot store into ->file := file , '.config'].
            "If path is not valid, this is probably because we are running the image on a different
            platform. Assume this is the case, and change the path to current default if it appears
            to be invalid."
            path := file copyUpToLast: FileDirectory pathNameDelimiter.
            (FileDirectory default directoryExists: path)
                ifFalse: [ file := file copyReplaceAll: path with: FileDirectory default pathName].
            vmMaker saveConfigurationTo: file.
            configFileName := file]


Reply | Threaded
Open this post in threaded view
|

Re: Problem with vmmaker-dtl.211.mcz

Eliot Miranda-2
by default the preference allowing assignment to block arguments is off in current CLosure images (and a good thing too).  But older code used it a lot since block arguments were really no more than temporaries of the enclosing home method.  The quick hack is to enable the preference.  The real solution is to rewrite the method so it doesn;t assign to the block argument.

best
Eliot

On Mon, Dec 20, 2010 at 8:30 AM, Casimiro de Almeida Barreto <[hidden email]> wrote:
Problem:

saveConfig
    "write info about the current configuration to a file."

    (UIManager default request: 'Save VMMaker configuration...' initialAnswer: self configFileName)
        ifNotNilDo: [:file | | path |
            ('*.config' match: file)
                ifFalse: [Cannot store into ->file := file , '.config'].
            "If path is not valid, this is probably because we are running the image on a different
            platform. Assume this is the case, and change the path to current default if it appears
            to be invalid."
            path := file copyUpToLast: FileDirectory pathNameDelimiter.
            (FileDirectory default directoryExists: path)
                ifFalse: [ file := file copyReplaceAll: path with: FileDirectory default pathName].
            vmMaker saveConfigurationTo: file.
            configFileName := file]






Reply | Threaded
Open this post in threaded view
|

Re: Problem with vmmaker-dtl.211.mcz

David T. Lewis
D'oh! Sorry about that, I'll fix it.

Dave

On Mon, Dec 20, 2010 at 11:03:11AM -0800, Eliot Miranda wrote:

> by default the preference allowing assignment to block arguments is off in
> current CLosure images (and a good thing too).  But older code used it a lot
> since block arguments were really no more than temporaries of the enclosing
> home method.  The quick hack is to enable the preference.  The real solution
> is to rewrite the method so it doesn;t assign to the block argument.
>
> best
> Eliot
>
> On Mon, Dec 20, 2010 at 8:30 AM, Casimiro de Almeida Barreto <
> [hidden email]> wrote:
>
> >  Problem:
> >
> > saveConfig
> >     "write info about the current configuration to a file."
> >
> >     (UIManager default request: 'Save VMMaker configuration...'
> > initialAnswer: self configFileName)
> >         ifNotNilDo: [:file | | path |
> >             ('*.config' match: file)
> >                 ifFalse: [Cannot store into ->file := file , '.config'].
> >             "If path is not valid, this is probably because we are running
> > the image on a different
> >             platform. Assume this is the case, and change the path to
> > current default if it appears
> >             to be invalid."
> >             path := file copyUpToLast: FileDirectory pathNameDelimiter.
> >             (FileDirectory default directoryExists: path)
> >                 ifFalse: [ file := file copyReplaceAll: path with:
> > FileDirectory default pathName].
> >             vmMaker saveConfigurationTo: file.
> >             configFileName := file]
> >
> >
> >
> >

>