Help me FileIn

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

Help me FileIn

Kirk Fraser
Somehow the design of Squeak omits "fileIn" from the same menu as "fileOut" so it's hard to know what works on fileOut is going to work on fileIn.  I'm trying to convert software written in another Smalltalk and it would help to file it in.  At least adopting each class to Squeak's fileIn format would be easier than copying in every method one at a time.  So please help me fileIn.  Thanks.


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help me FileIn

Randal L. Schwartz
>>>>> "Overcomer" == Overcomer Man <[hidden email]> writes:

Overcomer>  Somehow the design of Squeak omits "fileIn" from the same menu as
Overcomer> "fileOut" so it's hard to know what works on fileOut is going to
Overcomer> work on fileIn.  I'm trying to convert software written in another
Overcomer> Smalltalk and it would help to file it in.  At least adopting each
Overcomer> class to Squeak's fileIn format would be easier than copying in
Overcomer> every method one at a time.  So please help me fileIn.  Thanks.

The starting point for a fileOut is a class or package.  Hence, fileOut
appears there.

The starting point for a fileIn is a filename, from a file/directory browser.
Hence, fileIn appears there.

Does that help?

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help me FileIn

Kirk Fraser
Randal> Does that help?
 
Yes it does clarify where to more properly access fileIn, from a file list instead of the class definition middle button "more..." menu.  Thanks. 
 
I'm still stuck on making my file look enough like a Squeak fileOut to pass.  So I'll just do it by hand.   Some code will have to be rebuilt anyway. 

On Sat, Aug 15, 2009 at 7:34 PM, Randal L. Schwartz <[hidden email]> wrote:
>>>>> "Overcomer" == Overcomer Man <[hidden email]> writes:

Overcomer>  Somehow the design of Squeak omits "fileIn" from the same menu as
Overcomer> "fileOut" so it's hard to know what works on fileOut is going to
Overcomer> work on fileIn.  I'm trying to convert software written in another
Overcomer> Smalltalk and it would help to file it in.  At least adopting each
Overcomer> class to Squeak's fileIn format would be easier than copying in
Overcomer> every method one at a time.  So please help me fileIn.  Thanks.

The starting point for a fileOut is a class or package.  Hence, fileOut
appears there.

The starting point for a fileIn is a filename, from a file/directory browser.
Hence, fileIn appears there.

Does that help?

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help me FileIn

K. K. Subramaniam
On Sunday 16 Aug 2009 12:09:27 pm Overcomer Man wrote:
> Yes it does clarify where to more properly access fileIn, from a file
> list instead of the class definition middle button "more..." menu.  Thanks.
I find drag-n-drop from the native file manager to be easier than going through
Squeak FileList.
> I'm still stuck on making my file look enough like a Squeak fileOut to
> pass.  So I'll just do it by hand.   Some code will have to be rebuilt
> anyway.
Squeak fileOuts are binary files, not text; though they contain lot of ASCII
characters.

What exactly are you trying to do?
Subbu
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help me FileIn

Randal L. Schwartz
>>>>> "K" == K K Subramaniam <[hidden email]> writes:

K> Squeak fileOuts are binary files, not text; though they contain lot of
K> ASCII characters.

Really?  When did they change?

In classic Squeak, fileouts were basically the classic ST80 format,
which is clearly human-readable text.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help me FileIn

Kirk Fraser
subbukk> What exactly are you trying to do?
 
I'm trying to get object database functions to provide for my robot and an English dictionary.  I have some old code in a Dolphin package file I'm copying in but it seems unnecessarily complex.   I now think a database might be available as part of Seaside?   Many webpages require a database.

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help me FileIn

K. K. Subramaniam
In reply to this post by Randal L. Schwartz
On Sunday 16 Aug 2009 10:28:23 pm Randal L. Schwartz wrote:
> Really?  When did they change?
>
> In classic Squeak, fileouts were basically the classic ST80 format,
> which is clearly human-readable text.
But not native text files (they are not opened in ascii mode). Code fileOuts are
a database of data chunks. See Bert's explanation at:
  http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-May/116683.html

Subbu
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help me FileIn

K. K. Subramaniam
In reply to this post by Kirk Fraser
On Sunday 16 Aug 2009 11:00:51 pm Overcomer Man wrote:
> subbukk> What exactly are you trying to do?
>
> I'm trying to get object database functions to provide for my robot and an
> English dictionary.  I have some old code in a Dolphin package file I'm
> copying in but it seems unnecessarily complex.
You could try using the code browser - open->filelist..->code (with the file
selected) to browse the code chunks and take in only what you need.

Subbu

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help me FileIn

Randal L. Schwartz
In reply to this post by K. K. Subramaniam
>>>>> "K" == K K Subramaniam <[hidden email]> writes:

K> But not native text files (they are not opened in ascii mode). Code fileOuts are
K> a database of data chunks. See Bert's explanation at:
K>   http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-May/116683.html

That explanation is about .sources and .changes, not fileOuts.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help me FileIn

K. K. Subramaniam
On Monday 17 Aug 2009 12:17:25 am Randal L. Schwartz wrote:
> That explanation is about .sources and .changes, not fileOuts.
The class fileout (from browser into *.st files) uses the same format (sequence
of data chunks) as *.sources and *.changes files. Did you have some other
fileOuts in mind?

Subbu
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help me FileIn

Randal L. Schwartz
>>>>> "K" == K K Subramaniam <[hidden email]> writes:

K> On Monday 17 Aug 2009 12:17:25 am Randal L. Schwartz wrote:
>> That explanation is about .sources and .changes, not fileOuts.

K> The class fileout (from browser into *.st files) uses the same format
K> (sequence of data chunks) as *.sources and *.changes files. Did you have
K> some other fileOuts in mind?

Are you sure?

It looks like the fileout I *just* got is classic ST-80 format, with "!"
delimiting Smalltalk code.  There's no "binary" data in here... it's all
human-readable text (chunks of smalltalk code).  That's different from the
.sources and .changes, because they have some binary data in them (I thought).

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help me FileIn

K. K. Subramaniam
On Monday 17 Aug 2009 7:50:35 am Randal L. Schwartz wrote:
> K> On Monday 17 Aug 2009 12:17:25 am Randal L. Schwartz wrote:
> >> That explanation is about .sources and .changes, not fileOuts.
>
> K> The class fileout (from browser into *.st files) uses the same format
> K> (sequence of data chunks) as *.sources and *.changes files. Did you have
> K> some other fileOuts in mind?
>
> Are you sure?
Yes. fileOuts are binary streams, not ASCII (cf. Class>>fileOut and FileStream>>
writeSourceCodeFrom:.....).
> It looks like the fileout I just got is classic ST-80 format, with "!"
> delimiting Smalltalk code.  There's no "binary" data in here... it's all
> human-readable text (chunks of smalltalk code).  That's different from the
> .sources and .changes, because they have some binary data in them (I
> thought).
I made the same mistake a few years back. Just because a byteArray contains
readable text does not mean that it is becomes a string. Text is not portable
across platforms because of different line-ending conventions. If line
conversions are done on fileOut before filing in then any string literals with
newlines will get corrupted.

Subbu
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help me FileIn

Bert Freudenberg

On 17.08.2009, at 05:34, K. K. Subramaniam wrote:

> On Monday 17 Aug 2009 7:50:35 am Randal L. Schwartz wrote:
>> K> On Monday 17 Aug 2009 12:17:25 am Randal L. Schwartz wrote:
>>>>> http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-May/116683.html
>>>> That explanation is about .sources and .changes, not fileOuts.
>>
>> K> The class fileout (from browser into *.st files) uses the same  
>> format
>> K> (sequence of data chunks) as *.sources and *.changes files. Did  
>> you have
>> K> some other fileOuts in mind?
>>
>> Are you sure?
> Yes. fileOuts are binary streams, not ASCII (cf. Class>>fileOut and  
> FileStream>>
> writeSourceCodeFrom:.....).

Err, it's still text though.

>> It looks like the fileout I just got is classic ST-80 format, with  
>> "!"
>> delimiting Smalltalk code.  There's no "binary" data in here...  
>> it's all
>> human-readable text (chunks of smalltalk code).  That's different  
>> from the
>> .sources and .changes, because they have some binary data in them (I
>> thought).
> I made the same mistake a few years back. Just because a byteArray  
> contains
> readable text does not mean that it is becomes a string. Text is not  
> portable
> across platforms because of different line-ending conventions. If line
> conversions are done on fileOut before filing in then any string  
> literals with
> newlines will get corrupted.


You guys are confusing a couple of issues.

One is that the *.sources file and *.changes file is not simply a text  
file, because the image stores offsets into those files to find source  
code for a specific method. Hence you must not manually alter these  
files as you normally would edit source code, because that might  
invalidate the offsets - that's what I meant with "a database of text  
chunks" in the message linked above.

File-outs (*.st) and change-sets (*.cs) are a different matter. Here,  
no file offsets are stored anywhere so it is perfectly okay to edit  
them manually as text files.

The "binary data" I was talking about does not appear in regular file-
outs or change-sets. But the file-in process is so flexible that it  
can even be used to read binary data. That's because filing-in  
actually executes code found in the file. The first part of the file  
can define a reader that reads the later part of the file.

This makes it actually an "object-oriented" file format: the file  
itself is an object that defines how it is to be read. (According to  
Alan this idea goes back to the 1950's B5000 tapes.)

But it also makes it impossible to know in advance what kind of data  
might be included when filing in something. So one must not do  
automatic transformations of the file contents, which might break that  
data.

However, as I wrote, if the file is indeed named *.st or *.cs, then no  
such arbitrary data is expected. These files contain only Smalltalk  
source code - it's not enforced, but it would be very atypical if they  
contained something else.

- Bert -


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners