Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Am i missing something or does the CheckingAccount fail to actualy withdraw money unless its more than is in the account?
    • The CheckingAccount::withdraw method is actually "before" method advice. It will run that sub before running the superclass code (BankAccount). So what happens is that if there is not enough money in the account to cover the withdrawl, it will withdraw money from an account designated as the "overdraft account" to compensate.

      The method "advice" feature, is something found in CLOS and some AOP systems. This example is actually taken directly from the book Practical Common Lisp [gigamonkeys.com] (scroll down to the section entitled "The Standard Method Combination" to see). Moose also supports the other "method combinations" from CLOS too (after, around). In fact you can see an example of after is the Moose SYNOPSIS [cpan.org].

      -- Stevan