[#383997] CORE - Alternative Variable Substitution — Ilias Lazaridis <ilias@...>
ruby 1.9
On 1 =C9=EF=FD=ED, 12:12, Peter Hickman <peterhickman...@googlemail.com>
On 1 =C9=EF=FD=ED, 16:22, Robert Klemme <shortcut...@googlemail.com> wrote:
On Thu, 2 Jun 2011 13:25:25 +0900, Ilias Lazaridis wrote:
[#384020] instance variable in pseudo-global scope — Chad Perrin <code@...>
As I understand things:
On Wed, Jun 1, 2011 at 6:01 PM, Chad Perrin <code@apotheon.net> wrote:
[#384029] minitest 2.2.2 Released — Ryan Davis <ryand-ruby@...>
minitest version 2.2.2 has been released!
[#384051] CORE - Replace "if __FILE__ == $0" with "executed?" — Ilias Lazaridis <ilias@...>
The construct to detect execution of the file (in order to launch main
On Thu, 2 Jun 2011 22:30:27 +0900, Ilias Lazaridis wrote:
On Thu, Jun 02, 2011 at 10:51:46PM +0900, Peter Zotov wrote:
[#384072] Behaviour of different Proc types — Josh Cheek <josh.cheek@...>
I realized that I just can't ever remember the different proc types
[#384085] Best way to replace hash keys — Alex Allmont <Alex.Allmont@...>
What is the most optimal and neatest way to replace keys in a hash given a =
[#384104] CORE - Altering Behaviour of "each do" (default param "item") — Ilias Lazaridis <ilias@...>
1.9
Probably not without changing Ruby itself.
Actually it would be possible, although very ugly.
On Sat, Jun 4, 2011 at 6:50 AM, Ilias Lazaridis <ilias@lazaridis.com> wrote:
On Sat, Jun 04, 2011 at 11:50:00PM +0900, James Gray wrote:
On 5 =CE=99=CE=BF=CF=8D=CE=BD, 17:19, Matthias W=C3=A4chter <matth...@waech=
Hi,
Ilias Lazaridis wrote:
2011/6/7 J=C3=B6rg W Mittag <JoergWMittag+Ruby@googlemail.com>
On 6 =C9=EF=FD=ED, 01:11, Yukihiro Matsumoto <m...@ruby-lang.org> wrote:
On Monday, June 06, 2011 03:35:30 AM Ilias Lazaridis wrote:
On 06.06.2011 16:57, David Masover wrote:
On 6 =C9=EF=FD=ED, 01:11, Yukihiro Matsumoto <m...@ruby-lang.org> wrote:
Hi,
On 6 =CE=99=CE=BF=CF=8D=CE=BD, 12:24, Yukihiro Matsumoto <m...@ruby-lang.or=
On 8 =CE=99=CE=BF=CF=8D=CE=BD, 08:06, David Masover <ni...@slaphack.com> wr=
On Wed, Jun 8, 2011 at 11:50 AM, Ilias Lazaridis <ilias@lazaridis.com> wrot=
[#384208] Ruby 1.9 Time parse question — Paul <tester.paul@...>
Hi there!
[#384219] how to repackage a ruby gem. — William Liu <william.weih@...>
Hi All,
[#384228] a little challenge - reproduce this error — Intransition <transfire@...>
Want to see a really amazing error I got this week? Okay... but to
throw NameError.new("uninitialized constant X::Foo::X")
This is a pretty trivial error to generate. Just reference the
On Wed, Jun 8, 2011 at 6:43 AM, Intransition <transfire@gmail.com> wrote:
On Jun 8, 2011, at 10:56 AM, Christopher Dicely wrote:
On Jun 8, 10:56=A0am, Christopher Dicely <cmdic...@gmail.com> wrote:
On Wed, Jun 8, 2011 at 8:27 AM, Intransition <transfire@gmail.com> wrote:
> I realize now maybe how I should have phrased this as a challenge
On Jun 9, 1:22=A0pm, John Feminella <jo...@bitsbuilder.com> wrote:
On Fri, Jun 10, 2011 at 12:08 PM, Intransition <transfire@gmail.com> wrote:
[#384262] Where is the #hash method defined? — Iñaki Baz Castillo <ibc@...>
Hi, any object in Ruby has the method #hash which returns an integer
> I cannot find which class or module #hash method belongs to. I
[#384273] Anyone compiled VIM 7.3 with 1.9.2 support? — Ned <rails.nerd@...>
Hi
[#384279] CORE - Literal Instantiation breaks Object Model — Ilias Lazaridis <ilias@...>
class String
[#384280] BARRIER - require "rubygems" — Ilias Lazaridis <ilias@...>
ruby 1.9.2p180 Windows 7
On 11 =C9=EF=FD=ED, 20:30, Phillip Gawlowski <cmdjackr...@googlemail.com>
[#384283] Classic Computer Science Books — Stu <stu@...>
I wanted to start a thread discussion on classic computer science
On Thu, Jun 9, 2011 at 5:18 PM, Stu <stu@rubyprogrammer.net> wrote:
On Fri, Jun 10, 2011 at 09:22:58AM +0900, Josh Cheek wrote:
Thank you for the responses. I look forward to reading others.
> queue to read Meyers C++ books and Crockford's Javascript: The Good
Hello Anurag
Hey Stu,
Wow, those are a lot of books, as a beginner programmer, I don't have
There is a classic series online called "How to Think Like a Computer Scien=
On Thu, Jun 16, 2011 at 10:26 PM, Stu <stu@rubyprogrammer.net> wrote:
On 10.06.2011 00:18, Stu wrote:
The Design and Construction of Compilers, Robin Hunter, John Wiley &
[#384322] PSA: Ilias is Crazy — Ryan Davis <ryand-ruby@...>
I guess I have to post this periodically since our population is growing =
On 6/10/2011 12:41 PM, Ryan Davis wrote:
Since this has escalated to giving the guy a thread with his name in
[#384363] RFC - One word alias for require_relative — Ilias Lazaridis <ilias@...>
This is a simple Request for Comments.
On 16 =C9=EF=FD=ED, 19:45, "Matthew K. Williams" <m...@harpstar.com> wrote:
On Sat, Jun 11, 2011 at 9:12 PM, Intransition <transfire@gmail.com> wrote:
On Sat, Jun 11, 2011 at 11:08 PM, Intransition <transfire@gmail.com> wrote:
Back in the blissful days before I understood the `$LOAD_PATH` or the
On 15 =C9=EF=FD=ED, 22:26, Florian Gilcher <f...@andersground.net> wrote:
On 15 =C9=EF=FD=ED, 22:58, Michael Edgar <ad...@carboni.ca> wrote:
On 15 =C9=EF=FD=ED, 23:22, Michael Edgar <ad...@carboni.ca> wrote:
On 11 =C9=EF=FD=ED, 20:35, Ilias Lazaridis <il...@lazaridis.com> wrote:
On 16 =C9=EF=FD=ED, 17:29, Matt Harrison <iwasinnamuk...@genestate.com> wro=
On 16/06/2011 16:10, Ilias Lazaridis wrote:
On 16 =C9=EF=FD=ED, 20:26, Matt Harrison <iwasinnamuk...@genestate.com> wro=
On 16 =CE=99=CE=BF=CF=8D=CE=BD, 21:24, Jason Roelofs <jameskil...@gmail.com=
involve
On 16 =CE=99=CE=BF=CF=8D=CE=BD, 23:45, Adam Prescott <a...@aprescott.com> w=
On 11 =C9=EF=FD=ED, 20:35, Ilias Lazaridis <il...@lazaridis.com> wrote:
On 17 =C9=EF=FD=ED, 21:17, Gary Wright <gwtm...@mac.com> wrote:
2011/6/17 Ilias Lazaridis <ilias@lazaridis.com>:
On Mon, Jun 20, 2011 at 2:54 PM, Christopher Dicely <cmdicely@gmail.com> wrote:
On Monday, June 20, 2011 09:17:51 AM Adam Prescott wrote:
On 17 =C9=EF=FD=ED, 23:15, Phillip Gawlowski <cmdjackr...@googlemail.com>
2011/6/17 Ilias Lazaridis <ilias@lazaridis.com>
2011/6/17 Salk Pugh-Pitt <salk.pughpitt@gmail.com>
On Fri, Jun 17, 2011 at 4:32 PM, A. Stroh Turph <astroh.turph@gmail.com>wrote:
On Fri, Jun 17, 2011 at 4:37 PM, Salk Pugh-Pitt <salk.pughpitt@gmail.com>wrote:
On 11 =C9=EF=FD=ED, 20:35, Ilias Lazaridis <il...@lazaridis.com> wrote:
Hi,
On 18 =C9=EF=FD=ED, 02:30, Yukihiro Matsumoto <m...@ruby-lang.org> wrote:
On 19 =CE=99=CE=BF=CF=8D=CE=BD, 19:44, David Masover <ni...@slaphack.com> w=
On Sunday, June 19, 2011 12:20:28 PM Ilias Lazaridis wrote:
On 21 =CE=99=CE=BF=CF=8D=CE=BD, 21:55, I=C3=B1aki Baz Castillo <i...@aliax.=
[#384375] sequel question: Where's SQLite? — Chad Perrin <code@...>
So . . . I need to get the Sequel gem working with SQLite on a Debian
On Sat, Jun 11, 2011 at 2:30 PM, Chad Perrin <code@apotheon.net> wrote:
On Sat, Jun 11, 2011 at 2:55 PM, Mike Moore <blowmage@gmail.com> wrote:
On Sun, Jun 12, 2011 at 05:57:42AM +0900, Mike Moore wrote:
[#384432] commit message conventions — Intransition <transfire@...>
When I write commit messages I add a "team" prefix to the message,
I greatly dislike that style, to be frank. My commit messages usually
On Mon, Jun 13, 2011 at 7:58 AM, John Feminella <johnf@bitsbuilder.com> wro=
On Jun 13, 9:13=A0am, brab...@gmail.com wrote:
On Jun 13, 2011, at 9:55 AM, Intransition <transfire@gmail.com> wrote:
Agreed. Reference the ticket, which can hold all the data about what
[#384444] Hi rubies — medarkness arkness <rotakinrof@...>
[#384453] Regexp.match(line) question — m b <snert@...>
[#384467] A way to find out when a constant gets defined? — Josh Cheek <josh.cheek@...>
Hi, I'd like to be able to find out when a constant gets defined. I think I
> but the Bundler team
Okay, I think I found the ultimate source of the problem was that RVM said
On Tue, Jun 14, 2011 at 2:11 PM, Josh Cheek <josh.cheek@gmail.com> wrote:
[#384473] ruby-oci8 2.0.6 — Kubo Takehiro <kubo@...>
Ruby-oci8 2.0.6 is released. This is the Oracle module using OCI8 API.
[#384490] Messages to Ruby List/Forum/etc. not arriving equally? — Markus Fischer <markus@...>
Hi,
On Wed, Jun 15, 2011 at 2:20 AM, Markus Fischer <markus@fischer.name> wrote:
Hi,
On Wed, Jun 15, 2011 at 4:28 AM, Markus Fischer <markus@fischer.name> wrote:
http://www.ruby-forum.com/topic/2440238#1018634 arrived in the mailing list
[#384494] Plugin best practices — Intransition <transfire@...>
If your making a plugin/extension for another project, do you create a
[#384500] CORE - Inconsistent Handling of Uninitialized Variables — Ilias Lazaridis <ilias@...>
puts "\n== Testin in MAIN Context =="
On 15 =C9=EF=FD=ED, 21:05, Michael Edgar <ad...@carboni.ca> wrote:
On Jun 19, 2011, at 6:01 PM, Gary Wright wrote:
[#384521] queues? inotify? anything else? — Matt Harrison <iwasinnamuknow@...>
I don't even really know how to describe this problem. I know what I
[#384532] Kernel#autoload vs require_relative — Piotr Szotkowski <chastell@...>
I understand that for require to work relative to the given __FILE__=E2=80=
Ryan Davis:
On Thursday, June 16, 2011 11:50:57 AM Piotr Szotkowski wrote:
[#384579] win32-service gem — Daniel Stephens <danny.a.stephens@...>
Hey all, has anyone been able to use win32-service-0.7.0.gem. when I try to
[#384617] get execution name of program — Chad Perrin <code@...>
Either $0 or __FILE__ will return a filename to give context for how a
On Jun 17, 2011, at 1:49 PM, Chad Perrin wrote:
On Sat, Jun 18, 2011 at 03:03:50AM +0900, Michael Edgar wrote:
On Jun 17, 2011, at 2:16 PM, Chad Perrin wrote:
On Fri, Jun 17, 2011 at 11:16 AM, Chad Perrin <code@apotheon.net> wrote:
[#384634] default config file location — Chad Perrin <code@...>
Is there a "better" way to specify a default config file location than
Chad Perrin:
On Sat, 18 Jun 2011, Chad Perrin wrote:
On 6/17/2011 14:45, Matthew K. Williams wrote:
[#384648] celluloid 0.0.3: a concurrent object framework for Ruby — Tony Arcieri <tony.arcieri@...>
Celluloid is a concurrent object framework for Ruby inspired by Erlang
On Friday, June 17, 2011 03:21:48 PM Tony Arcieri wrote:
On Fri, Jun 17, 2011 at 4:25 PM, David Masover <ninja@slaphack.com> wrote:
On Friday, June 17, 2011 05:54:35 PM Tony Arcieri wrote:
On Fri, Jun 17, 2011 at 6:25 PM, David Masover <ninja@slaphack.com> wrote:
[#384650] Threadsafing a mixin module without using self.new or initialize. — Mike Bethany <mikbe.tk@...>
Threadsafing a mixin module without using self.new or initialize.
[#384687] how would you set dynamically determined dependencies with or without bundler? — Jarmo Pertman <jarmo.p@...>
Hi!
[#384697] test scope issue — Chad Perrin <code@...>
My tests are broken. I generally suck at writing tests, so please bear
[#384742] What about Object#to_ruby ? — Bernard Lambeau <blambeau@...>
Hi!
I believe pry has this kind of thing: https://github.com/banister/pry
On Mon, Jun 20, 2011 at 7:40 AM, Bernard Lambeau <blambeau@gmail.com> wrote:
[#384763] MIDASWAD - Matz is Dumb and so We are Dumb — Ilias Lazaridis <ilias@...>
(public draft)
Before anyone engages this nonsense . . .
On 20 Jun 2011 20:32, "Chad Perrin" <code@apotheon.net> wrote:
Five posts in on this thread, and four of them are the self appointed
On Mon, Jun 20, 2011 at 11:08 PM, Sam Duncan <sduncan@wetafx.co.nz> wrote:
On Mon, Jun 20, 2011 at 23:08, Sam Duncan <sduncan@wetafx.co.nz> wrote:
A quick, lazy response, because I shouldn't feed trolls anyway, and I simply
On Mon, Jun 20, 2011 at 23:52, David Masover <ninja@slaphack.com> wrote:
On Tue, Jun 21, 2011 at 11:06 AM, Nikolai Weibull <now@bitwi.se> wrote:
On Tue, Jun 21, 2011 at 13:37, Adam Prescott <adam@aprescott.com> wrote:
On Tue, Jun 21, 2011 at 1:39 PM, Nikolai Weibull <now@bitwi.se> wrote:
On Tue, Jun 21, 2011 at 14:51, Adam Prescott <adam@aprescott.com> wrote:
[#384784] REWORK - Task: Unify behaviour of by-literal-instantiated Objects — Ilias Lazaridis <ilias@...>
(Note: This task is part of the RUBY REWORK, which has (among other
[#384800] How to order a hash based on its keys? — Iñaki Baz Castillo <ibc@...>
Hi, I want to order a hash using itds keys:
On Tue, Jun 21, 2011 at 4:34 PM, I=F1aki Baz Castillo <ibc@aliax.net> wrote=
2011/6/21 Robert Klemme <shortcutter@googlemail.com>:
2011/6/21 I=C3=B1aki Baz Castillo <ibc@aliax.net>:
On Tue, Jun 21, 2011 at 6:34 PM, I=F1aki Baz Castillo <ibc@aliax.net> wrote=
2011/6/22 Robert Klemme <shortcutter@googlemail.com>:
On Wed, Jun 22, 2011 at 11:50 AM, I=F1aki Baz Castillo <ibc@aliax.net> wrot=
2011/6/22 Robert Klemme <shortcutter@googlemail.com>:
On Wed, Jun 22, 2011 at 3:47 PM, I=F1aki Baz Castillo <ibc@aliax.net> wrote=
2011/6/22 Robert Klemme <shortcutter@googlemail.com>:
On Wed, Jun 22, 2011 at 4:19 PM, I=F1aki Baz Castillo <ibc@aliax.net> wrote=
2011/6/22 Robert Klemme <shortcutter@googlemail.com>:
On Thu, Jun 23, 2011 at 12:11 AM, I=F1aki Baz Castillo <ibc@aliax.net> wrot=
2011/6/23 Robert Klemme <shortcutter@googlemail.com>:
On Thu, Jun 23, 2011 at 6:42 PM, I=F1aki Baz Castillo <ibc@aliax.net> wrote=
On Wed, Jun 22, 2011 at 11:50 AM, I=F1aki Baz Castillo <ibc@aliax.net> wrot=
[#384801] Once click, one (OO) life... — DavCori80 <davcori80@...>
Hi everyone,
[#384819] Gateway Shutting Down — James Gray <james@...>
Rubyists:
On Wed, Jun 22, 2011 at 1:47 AM, James Gray <james@graysoftinc.com> wrote:
On Wed, Jun 22, 2011 at 12:18 AM, Martin DeMello
[#384863] vlad 2.2.1 Released — Ryan Davis <ryand-ruby@...>
vlad version 2.2.1 has been released!
2011/6/23 Ryan Davis <ryand-ruby@zenspider.com>:
[#384864] Ruby embed called from a pthread — Luiz Angelo Daros de Luca <luizluca@...>
Hello guys,
[#384873] Explicitly setting compiler to C++ in extconf.rb... — "Darryl L. Pierce" <mcpierce@...>
I'm trying to setup a Ruby gem that bundles the Swig-generated bindings
Darryl L. Pierce escreveu isso a=ED:
On Jun 23, 2011, at 7:30 PM, Antonio Terceiro wrote:
On 06/23/2011 07:39 PM, Michael Edgar wrote:
[#384891] Honoring #to_ary and such — Intransition <transfire@...>
Well, for about the first time I am writing a library that has to be
On Fri, Jun 24, 2011 at 3:38 PM, Intransition <transfire@gmail.com> wrote:
[#384901] Symbol#=== — Intransition <transfire@...>
As:
On Sat, Jun 25, 2011 at 7:57 AM, Intransition <transfire@gmail.com> wrote:
On Sat, Jun 25, 2011 at 9:15 PM, Intransition <transfire@gmail.com> wrote:
[#384907] SPDX (and the glazing of ones eyes) — Intransition <transfire@...>
Never ceases to amaze me how complicated "enterprisey" peoples can
On Sat, Jun 25, 2011 at 10:00 AM, Intransition <transfire@gmail.com> wrote:
On Jun 25, 11:11=A0am, Josh Cheek <josh.ch...@gmail.com> wrote:
On Sun, Jun 26, 2011 at 04:41:06AM +0900, Intransition wrote:
On Sat, Jun 25, 2011 at 5:00 PM, Intransition <transfire@gmail.com> wrote:
<snip>
On Jun 25, 11:54=A0am, Phillip Gawlowski <cmdjackr...@googlemail.com>
On Sat, Jun 25, 2011 at 9:36 PM, Intransition <transfire@gmail.com> wrote:
[#384927] Single Responsibility Question — Mike Bethany <mikbe.tk@...>
I'm trying to figure out who's responsible for a resource.
On Sun, Jun 26, 2011 at 2:22 AM, Mike Bethany <mikbe.tk@gmail.com> wrote:
Thanks Robert, you always have excellent feedback.
[#384931] Rubicle, the unofficial Ruby mascot, released — info@...
Hello! We are rubicle.net administrators. We have released Rubicle, the UNOFFICIAL
So this is Ruby-tan? (ala http://en.wikipedia.org/wiki/OS-tan)
On Sun, Jun 26, 2011 at 2:26 PM, Tony Arcieri <tony.arcieri@gmail.com>wrote:
[#384945] unicorn 4.0.0 - Rack HTTP server for fast clients and Unix — Eric Wong <normalperson@...>
Unicorn is an HTTP server for Rack applications designed to only serve
[#384950] Understanding Threading... — "Darryl L. Pierce" <mcpierce@...>
I'm working on a use case where I need to spawn a thread that handles a
[#384976] clock-scheduled operations — Chad Perrin <code@...>
Obviously, scheduling something to happen every foo seconds is easy.
[#384982] here docs: WTF am i doing wrong??? — serialhex <serialhex@...>
ok, so i'm trying to create a here doc for a little program i'm writing and
[#384996] A movie Renamer — Mayank Kohaley <mayank.kohaley@...>
Hello Guys,
Please don't steal movies.
On Thu, Jun 30, 2011 at 06:17:55AM +0900, Sam Duncan wrote:
*sigh*
Really didn't want to get into this, especially since it seems like everyone
[#385002] Specifying non-standard include/lib directories on gem install... — "Darryl L. Pierce" <mcpierce@...>
Is it possible to specific non-standard directories when installing a
[#385019] A File Renamer — Mayank Kohaley <mayank.kohaley@...>
I guess this thread has spawned another issue. Let me close this and say I
On Thu, Jun 30, 2011 at 1:48 AM, Mayank Kohaley
> Is there a pattern to the file names you are working with? The key is
On Thu, Jun 30, 2011 at 10:55 AM, Johnny Morrice <spoon@killersmurf.com>wrote:
You should be aware that meta data can't be trusted. Not only do people not
On Thu, Jun 30, 2011 at 3:37 PM, Mike Bethany <mikbe.tk@gmail.com> wrote:
Re: [ANN] celluloid 0.0.3: a concurrent object framework for Ruby
On Saturday, June 18, 2011 05:40:09 PM Tony Arcieri wrote:
> On Fri, Jun 17, 2011 at 6:25 PM, David Masover <ninja@slaphack.com> wrote:
> > Still, I shouldn't have to create an entire new actor, link it to your
> > actor,
> > and have it trap errors in order to find the actual exception I caused
> > which
> > lead to the actor's death. Maybe it's appropriate for bang methods to
> > return
> > some object which can be used to retrieve an exception?
[...]
> I don't think there's a
> lot of good use cases for having callers handle errors in asynchronous
> calls that aren't already covered by Celluloid::Future.
Maybe not, other than that Future applies to a block, where I want the result
of a method call. Maybe it's not a good use case, but this still seems cool:
actors.map(&:some_calculation).reduce{|a,b| ...}
I guess the bigger annoyance, though I didn't really have a good solution, is
that adopting bang to mean "asynchronous" means that these don't quite quack
like Ruby objects anymore -- they can't have bang methods of their own that
mean something, and every method gets a bang whether it makes sense or not.
> You're actually the second person I've talked to who's proposed this in
> regard to handling circular call chains, the other person was Steven Parkes
> who created the Dramatis actor framework. At the time I had my head in
> Reia/Erlang, where gen_server state is pure functional and immutable and
> there would really be no way to implement this sort of approach. In a
> language like Ruby, though, it's possible, and would actually be quite
> similar to what you could do with plain old Ruby objects.
So, it's been awhile since I looked at Erlang, but I don't actually see an
obstacle to this in Erlang itself or in the VM. Maybe in gen_server.
But there's really nothing preventing me from creating the effect of mutable
state in a generic Erlang process, right?
> > So, there is a way, but you probably won't like it...
>
> You're right, I don't like that at all :)
I don't like it either, and I avoided it as much as I could. One thing I
thought of was trying to filter the reference any way that it would get out of
the object, since I was already wrapping things in futures and the like
anyway. The problem is, there's no guarantee that a bare 'self' will cross any
filter I set up. I mean, it'd be almost trivial to catch this:
def get_self
self
end
But what if they stuff it deep in some data structure? What if it's in a call
to some other object?
The other option was to make the blankslate-like proxy class a child class of
the original, so calling method 'foo' would look like:
original.instance_method(:foo).bind(self).call(*args, &block)
That's a minor win in that it might be somewhat more tolerant of the parent
classes being redefined. But it's not much of a win, because I have to watch
the parent classes anyway to remove methods from the child -- in fact, the
only sane way I could find to do that was to watch every single method
created. So this doesn't really buy me much.
A way to make that significantly better would be to bind those methods to a
BasicObject proxy instead, but you can't do that, because binding methods is
one case where Ruby is _not_ duck-typed at all -- you can only bind a method
to an object which is actually an instance of that class, or something which
inherits from or includes it.
In the end, while the approach I went with is pretty ridiculous, I still like
it for the simple reason that if I forget to call Celluloid.current_actor
instead of self, I've completely broken the concurrency model by doing the
normal Ruby thing. With my approach, aside from the fact that my attempt at
cycles currently deadlocks, I can still more or less pretend that an actor is
a normal object.
> > supervisor = Sheen.supervise "Charlie Sheen"
> > charlie = supervisor.actor
> >
> > This would solve both problems, right? (Assuming the supervisor is itself
> > threadsafe.) It could use some sugar, but I'm not entirely sure how.
>
> The easiest way to add some sugar would be to have the supervisor create a
> thread safe proxy object that always refers to the latest version of a
> given actor. That way you could just use that object directly rather than
> always having to call supervisor.actor to get to it.
Except in this case, I'm thinking of the call to 'supervisor.actor' as being
something like starting a transaction. That is, let's say someone actually
convinces (or court-orders) Sheen to go to rehab before we let him back on the
road. So we might have a series of calls like:
charlie.rehab!
charlie.give license
But maybe the withdrawal kills him. If 'charlie' is a thread-safe proxy which
always refers to the latest version, we end up with a situation where rehab
kills him, we get a new version who hasn't been to rehab, and we give the new
version a license. This is clearly an error, and worse, it's almost silent.
By contrast, if we force people to call something like supervisor.actor to
start something like this, we end up with the best of both worlds -- we're
guaranteed he's alive before we send him to rehab, and we either fail (because
we have a dead actor) or ensure that he's actually recovered before we give
him the license.
Or, in other words, any time we're sending more than one message to an actor
and depending on those messages being processed in order, we need to know, at
a _minimum_, that we're talking to the same actor. On the other hand, in a
situation like this, we also have to think about what other calls might happen
in between -- for example:
charlie.rehab! if charlie.out_of_control?
There's potentially a race condition between receiving the out_of_control?
value and sending him to rehab. Still, if someone else kills charlie, he's
just as dead and I still don't want to give the new version a license until he
goes through rehab again.
Also: There has got to be a better metaphor.