[#1207] warning in ruby extension eats memory — Eugene Scripnik <Eugene.Scripnik@...>

This message was posted to ruby-talk, but I didn't get responce from

22 messages 2003/07/01
[#1208] Re: warning in ruby extension eats memory — ts <decoux@...> 2003/07/01

>>>>> "E" == Eugene Scripnik <Eugene.Scripnik@itgrp.net> writes:

[#1209] Re: warning in ruby extension eats memory — Eugene Scripnik <Eugene.Scripnik@...> 2003/07/02

ts wrote:

[#1210] Re: warning in ruby extension eats memory — ts <decoux@...> 2003/07/02

>>>>> "E" == Eugene Scripnik <Eugene.Scripnik@itgrp.net> writes:

[#1211] Re: warning in ruby extension eats memory — Eugene Scripnik <Eugene.Scripnik@...> 2003/07/04

ts wrote:

[#1212] Re: warning in ruby extension eats memory — ts <decoux@...> 2003/07/04

>>>>> "E" == Eugene Scripnik <Eugene.Scripnik@itgrp.net> writes:

[#1213] Re: warning in ruby extension eats memory — Eugene Scripnik <Eugene.Scripnik@...> 2003/07/04

ts wrote:

[#1214] Re: warning in ruby extension eats memory — ts <decoux@...> 2003/07/04

>>>>> "E" == Eugene Scripnik <Eugene.Scripnik@itgrp.net> writes:

[#1215] Re: warning in ruby extension eats memory — Eugene Scripnik <Eugene.Scripnik@...> 2003/07/04

ts wrote:

[#1237] FTP.new with block — Gavin Sinclair <gsinclair@...>

Hi,

22 messages 2003/07/19
[#1238] Re: [Patch] FTP.new with block — ts <decoux@...> 2003/07/19

>>>>> "G" == Gavin Sinclair <gsinclair@soyabean.com.au> writes:

[#1240] Re: [Patch] FTP.new with block — Mathieu Bouchard <matju@...> 2003/07/19

[#1297] Fix for Bug 1058 — Markus Walser <walser@...>

Hi,

16 messages 2003/07/25

Re: [Patch] FTP.new with block

From: Mathieu Bouchard <matju@...>
Date: 2003-07-19 15:57:59 UTC
List: ruby-core #1240
On Sat, 19 Jul 2003, ts wrote:
> >>>>> "G" == Gavin Sinclair <gsinclair@soyabean.com.au> writes:
> G> FTP.new and FTP.open are like their File counterparts: they accept a
> G> block, pass in the ftp object, and ensure the FTP connection is closed
> G> at the end of (or premature exit from) the block.
>  Why all persons think that File::new can take a block ?

That's psychological: when people have a lot of things to learn, they
(carefully or not) forget the pieces that they can reinvent on the fly.

The brain can thus achieve a quite good compression ratio on a lot of
things. This is why consistency is good, as it makes things more
compressible.

Sometimes the forgetting may be careful and almost deliberate, and thus
lossless or almost, sometimes that's more careless and lossy but with the
knowledge that the memory is partial, and sometimes people have the
impression of remembering something exactly while the memory has been
lossy.

[That may be something well-known in psychology but I don't have formal
knowledge in that so I couldn't tell. Let's just call it the Matju
Hypothesis (tm) for now. heh]

So I think that in this particular case, it works like this:

1. people think they know the Ruby API
2. people only ever use File.open
3. people know the block option thereof and use it
4. people know there is a File.new
5. people know Ruby has an "alias" feature and that matz uses it
   (eg. Array#indices,#indexes; Enumerable#collect,#map)
6. people know that File.open and .new play the same role
7. people think there is no point in making File.open not like .new.
8. so people assume there is a common method, with an alias.

that makes sense to anyone?

________________________________________________________________
Mathieu Bouchard                       http://artengine.ca/matju


In This Thread