On Fri, Aug 25, 2006 at 10:17:11PM +0900, Matthew J.son wrote:
accomplished in the same way since the two forms of definition are
semantically equivalent. If I remember correctly (it has been quite
a while since I’ve looked at Lisp and Scheme) this is actually a
difference between Scheme and Lisp. Scheme has a single namespace
for variable definitions and function definitions whereas in Common
Lisp the two are separate. I actually much prefer the Scheme
approach and consider it to be more beautiful and simple. The
biggest barrier to something like this in Ruby (at least in 1.8.x) is
that the parameters are handled slightly differently for the two (ex.
procs cannot take a block).
I wasn’t aware of that – it seems like a pretty severe (if rarely
imposing) limitation. At first glance, it also looks like a largely
arbitrary limitation, though I’m pretty sure there are at least
implementation issues involved, since last I checked the Ruby community
doesn’t seem to suffer from Guidoism (aka: lambdas are one line of code,
period, because I say so, also period).
I wasn’t aware of that – it seems like a pretty severe (if rarely
imposing) limitation. At first glance, it also looks like a largely
arbitrary limitation, though I’m pretty sure there are at least
implementation issues involved, since last I checked the Ruby
community
doesn’t seem to suffer from Guidoism (aka: lambdas are one line of
code,
period, because I say so, also period).
This has been changed in Ruby 1.9 so it seems to open the possibility
of changing things in the future (to a unified method and variable
namespace), although I would be surprised if such a change were to
happen.
Matthew
On Fri, Aug 25, 2006 at 09:18:39AM +0900, Matthew J.son wrote:
There are languages (Scheme is one if I remember correctly) where the
two are semantically equivalent and thus () is used as a call
operator for both types of definitions. All functions / methods are
anonymous unless bound to a name. In such a language this would
indeed be a redefinition of the method as def is simply syntactic
sugar. This is approach is clean and simple in many respects, but is
different than the approach Ruby takes. Unless Ruby were to change
its semantics (not likely) I think David is right that this approach
won’t work in Ruby.
. . . except that in Lisps the () is list syntax, and the reason
closures and methods share that syntax is that everything is a list.
That’s my understanding, anyway. Then again, I’m no Lisp expert.
On the other hand, Perl might be a good example of unified syntax for
methods and closures. In both cases, calling the thing involves a
dereferencing, for which ->() is the syntax.
Hey
I can’t seem to get this simple DRb client to access the server over my
network…
I get a bad file descriptor error.
############# The Client Script ################
require ‘drb’
DRb.start_service
server = DRbObject.new(nil, “druby://#{ARGV.shift}”)
my_id = server.initialize_me
puts my_id
############# The Server Script ###############
require ‘drb’
class PerformAlexaUpdate
def initialize_me
return ‘hello’
end
end
h_server = DRb::DRbServer.new ‘druby://127.0.0.1:5555’,
PerformAlexaUpdate.new
h_server.thread.join
###########################################
Any ideas will be greatly appreciated!
Thanks in advance,
Gustav
On 9/9/06, Joel VanderWerf [email protected] wrote:
What about using an eternally visible network interface, in place of
loopback?
An eternally visible network interface! I can’t decide if that’s every
sysadmin’s dream or nightmare.
Sorry, Joel, no offense meant, but I couldn’t resist 
Gustav - Railist wrote:
Hey
I can’t seem to get this simple DRb client to access the server over my
network…
…
h_server = DRb::DRbServer.new ‘druby://127.0.0.1:5555’,
What about using an eternally visible network interface, in place of
loopback? (Or did you just put that in for the question to a public
list?) Try druby://localhost:5555, for example.