user-pic

Salvador Fandiño

  • About: yaph
  • Commented on A (not so) simple matter of privacy
    # which fields are visible from this eval? Isn’t the answer simply “none”? Yes, that was the conclusion: it is not a good idea to let lexical subroutines, declared at the class top level, access the object fields. It...
  • Commented on A (not so) simple matter of privacy
    I imagine that extending that per-object look-up to lexical subroutines as well would be quite a bit trickier. The implementors might not be willing — or even able — to do so. Yes, and there are other issues. AFAIK,...
  • Commented on A (not so) simple matter of privacy
    So now every method call is more expensive and more confusing. It’s a method call, but it doesn’t always dispatch polymorphically to the bottom of the inheritance hierarchy to call the most derived method; sometimes it dispatches statically into...
  • Commented on A (not so) simple matter of privacy
    Private methods by their very nature don’t participate in inheritance, so you should get: return $self->foo # A::foo() called + $b->foo # Can't call private B::foo() outside class B + $c->foo; # C::foo() if public, otherwise exception Oh, no,...
  • Commented on A (not so) simple matter of privacy
    Because sub calls and method calls are different constructs with different interfaces and behaviours I think that is exactly the point where we disagree. I see them as different constructs but their interface and behaviors are so similar, that...
  • Commented on A (not so) simple matter of privacy
    No, subs are always looked up at runtime Well, I think this is just a semantic issue, but by lookup I was referring to the operation of traversing one or several tables containing mappings between names and the subroutines...
  • Commented on A (not so) simple matter of privacy
    If methods can be called like subs, then every sub call now also has to check whether there's a suitable method to call instead. IIRC, perl does subroutine look up at compile time*. For instance, that's how arguments for subroutines...
  • Commented on A (not so) simple matter of privacy
    But precisely, my point is that you don't need to specify explicitly the object when calling a private method as it must be the same one that was used to invoke the current method from where the private one is...
  • Commented on A (not so) simple matter of privacy
    Couldn't lexical subs be extended to just work as private methods too: class A { has $x; my sub _print_x() { # private method say "x value for $self is $x"; } method print_x() { _print_x(); # calling it, no...
  • Commented on Open Letter to the Perl Foundation Board
    +1 from YAPH...
  • Posted Twenty years ago... to Salvador Fandino

    Twenty years ago today I released my first CPAN module: Fork::Queue.

    Then there was a group of people supervising module names, and they advised me to move it under the Proc namespace and so it became Proc::Queue.

    A couple of weeks…

  • Commented on The Future of Perl 5
    What would you like to see in the future of Perl 5? I would go for proper exception handling. Both providing try/catch/throw (or similar) keywords, and getting the core to generate object exceptions for errors instead of strings....
  • Commented on A very easy way to create XML
    Last year, also facing the problem of generating XML from Perl in a simple way I developed and released XML::FromPerl which is a very thin layer on top of XML::LibXML. Some code using it to generate complex XML can be...
  • Posted I was at the London Perl Workshop 2017 to Salvador Fandino

    ... and have blogged about it here!

  • Posted YAPC::Europe::2016 to Salvador Fandino

    My impressions on this year conference are here!

  • Commented on Brutally Solving a Logic Puzzle with Perl 6
    That kind of puzzles can usually be nicely and efficiently solved using constraint programming. For instance, this Gist solves it in Prolog using a finite domain constraint solver. With Perl 6 trying to be a multi-paradigm programming language, I would...
  • Posted Another release of Net::SSH2 is comming... test it, please! to Salvador Fandino

    I have been working on a new release of Net::SSH2 that has undergone mayor, mostly internal, changes.

    There are not too many new features. The aim has been to simplify the code, made it reliable and improve the overall consistency and behavior of the module.

    Most important changes are …

  • Commented on I think subroutine signatures don't need arguments count checking
    In relative terms, the time required to check that the number of arguments given matches the signature is probably insignificant. Have you run any benchmark?...
  • Posted Help me test Net::SSH2 to Salvador Fandino

    Short story

    I have released a new development version of Net::SSH2.

    Help me test it, please!

    Really long story

    Some years ago, I started working on

  • Commented on PDL features I'd like to see in Perl 6
    In my perfect world, you don't need autoloop at all. The compiler should be able to infer the dimmensions mismatch and do the autoloop itself, and on the way, use multiple CPUs when available and vectorization extensions efficiently....
  • Commented on YAPC::EU 2015 from 2nd to 4th September
    In my case, I can seldom attend YAPC::Europe because of it happening during my kids holidays (that BTW, in Spain last until mid September!)...
  • Posted Granada Perl Workshop to Salvador Fandino

    Less than three weeks remain for the Granada Perl Workshop that will take place on the Friday 27th of June in Granada (Spain).

    The good news is that, thanks to our sponsors, finally, th…

  • Commented on On Giving Back
    Hi Alex, I really like and applaud your module-of-the-month initiative. I just hope more companies take you as an example and start doing the same!...
  • Commented on On Giving Back
    It is not my intention to get anybody to pay me, I was just using me as an example. My point is that if some company, uses somebody module and they help that somebody to get work done on that...
  • Posted On Giving Back to Salvador Fandino

    A few days ago I published Math::Vector::Real::Farthest, my 100th CPAN module. I got into CPAN in 1999 so it has been a long, mostly quiet, way.

    Some modules were a side effect of my paid work, done while contracting or, l…

  • Commented on Smoke testing on Windows
    AFAIK, Net::SFTP::Foreign, Net::SSH2 and Net::SSH::Any work on Windows....
  • Posted Finding my computer to Salvador Fandino

    A couple of days ago I replaced my computer at work with a new one. This morning, working from home, when I tried to log in, it didn't respond.

    I realized promptly that I had forgotten to ask the sys admin to update the MAC address on the DHCP server and so it just got some random IP from …

  • Commented on p5-MOP gets p6 style traits (sorta)
    The idea is that the "argument" to the trait actually points to an in-scope subroutine I would expect it to result in some metaclass method being called....
  • Commented on Perl 7 - Final Thoughts
    Pe(a)rl++ == Rhodochrosite Though, I would be more worried about who is going to make the successor of Perl 5 a reality than about its name!...
  • Commented on Perl 5, Perl 6, Perl 7, Perl 2013, whatever
    Ricardo, thank you for your detailed and thoughtful answer....
Subscribe to feed Recent Actions from Salvador Fandiño

  • Damian Conway commented on A (not so) simple matter of privacy


    to some readers, because in the Corinna proposal “slots” have now been
    renamed to “fields”, and the slot keyword is now field as well.
    I’ll attempt to consistently use “field” and field from here on.]



    ...the issue is that lexical subs don't have access to the object state.
    They only can acces…

  • Damian Conway commented on A (not so) simple matter of privacy

    The $obj->&private_method() syntax has a
    few more benefits than just being available.

    For a start, it is analogous to the existing $obj->$subref() syntax.
    Which, incidentally, does not perform polymorphic dispatch either.

    It is also consistent with the Raku call-a-named-subroutine-as-a-method syntax

  • Aristotle commented on A (not so) simple matter of privacy
    # which fields are visible from this eval?

    Isn’t the answer simply “none”? It seems a trick question. Fields aren’t visible inside a sub, whether it’s lexical or not, no?

  • Aristotle commented on A (not so) simple matter of privacy
    I would expect the following code to work:

    Well, yes, obviously, a closure is a different kind of situation. The question would be what happens in a named sub declared inside a method – where I would expect the exact same behaviour that the “variable will not stay shared” warning cautions against currently. And I would expect the use of a lexical sub to cure the problem, the same way it currently does for regular subs.

  • Toby Inkster commented on A (not so) simple matter of privacy
    method $do_internal () {
      ...;
    }
    

    has been supported by Zydeco for over a year. documentation.

Subscribe to feed Responses to Comments from Salvador Fandiño

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.