From: Florian Gross Date: 2004-11-14T00:48:24+09:00 Subject: Re: assert Gavin Sinclair wrote: >>>>I have thought about changing the name to "assume" so it can be included >>>>in dev-utils, but I'm not sure if that name is better. >>I think that would be way too much magic. I'd expect the method to just >>take a block. > > Why a block? The breakpoint code uses Binding.of_caller anyway, so a > block is not needed for evaluation. I don't see any other reason, > technical or stylistic, why a block should be preferred. Using strings for code is a bit ugly. We have blocks in Ruby, why not use them? Using a String also causes a bit of escaping trouble (I know this can be worked around via the %{} or <<-END syntax, but I still think blocks are clearer than that.) > I suppose we might as well dispose of the symbolic argument and just > do this: > > breakpoint_unless 'x + y == 10' Why don't just use "breakpoint unless x + y == 10" then? I think it makes sense to use something more concise here. > Can you expand on the "too much magic"? I don't know -- the syntax just seemed so very unnatural. Like something you wouldn't meet anywhere in the standard library...