Einzelnen Beitrag anzeigen
Alt 23-02-2003, 10:14   #11 (permalink)
flory
www.kruesch.de
 
Benutzerbild von flory
 
Registriert seit: Feb 2002
Beiträge: 1.057
ja, schön!
so wäre es denke ich erlaubt, weil ? : ja eine Expression ist:
ActionScript:
  1. Function.prototype.loop = function(x) {
  2.     x--;
  3.     var f = this;      
  4.     return (x<0) ? null : function () {
  5.                 f.apply(f, arguments);
  6.                 f.loop(x).apply(f, arguments);
  7.         }
  8. };

und noch ein interessanter Code-Schnipsel:
ActionScript:
  1. Function.prototype.keepArguments=function() {
  2.     var f=this;
  3.     var args=arguments;
  4.     return function() {
  5.        return f.apply(f, args);
  6.     }
  7. }
  8. z=function(x,y) {
  9.   return x*y;   
  10. }
  11. z1=z.keepArguments(2,3);
  12. trace(z1());
__________________
www.planet-xaml.net

Geändert von flory (23-02-2003 um 10:32 Uhr)
flory ist offline   Mit Zitat antworten