[OT, unix] Looking for recursive soft linking incantation

Avi Bryant avi at beta4.com
Fri Feb 8 21:41:05 UTC 2002


On Fri, 8 Feb 2002, Tim Rowledge wrote:

> Avi Bryant <avi at beta4.com> is claimed by the authorities to have written:
>
> > This seems to do it, although you probably wanted something with a more
> > widespread interpreter:
> I was rather expecting something shell-ish, but this is interesting; it
> almost makes sense!
>
> I thought ruby was supposed to be object oriented though? Why would one
> need to use File.basename(srcfile) instead of 'srcfile basename' or
> 'basename(srcfile)' etc ? Puzzling...

Yes, Ruby's object model is identical to smalltalk's (well, plus mixins),
but the file libraries are perversely designed so that everything useful
is a class method that takes a string.  I considered adding methods like

class String
  def basename
    File.basename(self)
  end

  def mkdir
    Dir.mkdir(self)
  end
end

etc, so that the code would read more naturally, but it would have doubled
the length of the script ;-).





More information about the Squeak-dev mailing list