help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fileOut & methodCategory


From: Quenio
Subject: Re: fileOut & methodCategory
Date: Wed, 10 Feb 2021 23:40:25 +0000

Thanks for checking it, David.

It seems the problem occurs when defining a class interactively in the
shell, and using the methodCategory: method.

On February 10, 2021, "stes@PANDORA.BE" <stes@telenet.be> wrote:
> Hello Quenio,
>
> I can reproduce what you report.
>
> I believe that the fileOutOn: requires the "Parser" package.
>
> st> PackageLoader fileInPackage: 'Parser'.
>
> is required according to the documentation (and to make it actually
> fileOut).
>
> When I use the fileIn: method it works for me:
>
> With a small file "test.st" :
>
> # cat test.st
> !Test methodsFor: 'test'!
> test
>  self subclassResponsibility! !
>
> and then:
>
>  FileStream fileIn:'test.st' !
>
>
> When I fileOut then:
>
> st> Test fileOutOn: stdout.
>
>  test [
>  <category: 'test'>
>  self subclassResponsibility
>  ]
>
> So in that case <category: 'test'> is in the output.
>
> Regards,
> David Stes
>
> ----- Op 6 feb 2021 om 19:28 schreef help-smalltalk help-
> smalltalk@gnu.org:
>
> > Hello,
>
>
>
> > I was wondering if someone may have run into the following issue.
>
>
>
> > In the test below, the method's category has been set after the
> method
>
> > had been defined. Should it be expected the method's new category to
> be
>
> > filed out with the method's block?
>
>
>
> > st> Object subclass: #Test.
>
> > my.Test
>
>
>
> > st> Test extend [
>
> > st>   test [
>
> > st>     self subclassResponsibility
>
> > st>   ]
>
> > st> ]
>
>
>
> > st> (Test >> #test) methodCategory: 'test'.
>
> > Test>>test
>
>
>
> > st> (Test >> #test) methodCategory.
>
> > 'test'
>
>
>
> > st> Test fileOutOn: stdout.
>
> > "Filed out from GNU Smalltalk version 3.2.5 on 6-Feb-2021 18:17:35"
>
>
>
> > Smalltalk.Object subclass: Test [
>
> >    
>
> >    <category: nil>
>
> >    <comment: nil>
>
>
>
> >    test [
>
> >    self subclassResponsibility
>
> >  ]
>
> > ]
>
>
>
> > If the behavior above is expected, would it be possible to do some
> sort
>
> > of refresh/decompilation before executing the fileOut?
>
>
>
> > Also, would there be a better way to fileOut all classes in a
> namespace
>
> > / package?
>
>
>
> > Thanks in advance,
>
> >    Quenio


reply via email to

[Prev in Thread] Current Thread [Next in Thread]