The end result of a confusing sentence with no
>
> context is that I have no idea what you are trying to say. Could you try
>
> explaining again please?
>
>
> Steven
No problem my reply from phone at work a little confusing.
So trying to determine what this does.
def ins_var
@ins_var ||
flebber wrote:
> I thought that it was a shortcut in ruby to negate the other option of
> providing another default .
I'm afraid I can't work out what that sentence means, "to negate the other
option of providing *another* default"? How many defaults are you
providing? Then you negate *the option
I thought that it was a shortcut in ruby to negate the other option of
providing another default .
I don't greatly know ruby but took a guess after reading examples here
https://blog.neowork.com/ruby-shortcuts
--
https://mail.python.org/mailman/listinfo/python-list
flebber writes:
> On Monday, 6 October 2014 21:07:24 UTC+11, roro codeath wrote:
> > in ruby:
> >
> >
> > module M
> > def ins_var
> > @ins_var ||= nil
> > end
...
> I took || to be a ternary. So I assumed your code just sets ins_var
> to nil and then is called in module m and supplied a val.
On Monday, 6 October 2014 21:07:24 UTC+11, roro codeath wrote:
> in ruby:
>
>
> module M
> def ins_var
> @ins_var ||= nil
> end
>
>
> def m
> @ins_var = 'val'
> end
>
>
> def m2
> m
> ins_var # => 'val'
> end
> end
>
>
> in py:
>
>
> # m.py
>
>
> # how to def ins_var
>
>
> def m:
>
roro codeath wrote:
> in ruby:
>
> module M
> def ins_var
> @ins_var ||= nil
> end
>
> def m
> @ins_var = 'val'
> end
>
> def m2
> m
> ins_var # => 'val'
> end
> end
I admit that my Ruby skills are admittedly pretty lousy. Still, I used to
think that Ruby was pretty readable, but I find the a
On 06/10/2014 11:45, David Palao wrote:
Hello,
If you explain what the ruby code does, I think much more people will
be able to help you. Don't forget, this is a Python list. Not
everybody knows Ruby here.
Best
2014-10-06 12:06 GMT+02:00 roro codeath :
in ruby:
Please don't top post here, t
Hello,
If you explain what the ruby code does, I think much more people will
be able to help you. Don't forget, this is a Python list. Not
everybody knows Ruby here.
Best
2014-10-06 12:06 GMT+02:00 roro codeath :
> in ruby:
>
> module M
> def ins_var
> @ins_var ||= nil
> end
>
> def m
> @ins_var