On Jul 22, 7:47 pm, wheres pythonmonks <wherespythonmo...@gmail.com>
wrote:
> Thanks for pointing out that swap (and my swap2) don't work everywhere
> -- is there a way to get it to work inside functions?

Impossible without hacking the interpreter.


> "No offense, but you seem like you're still tying to be a hacker.  If
> that's what you want, fine, but generally speaking (and particularly
> for Python), you are going to have a better experience if you do it
> the language's way."
>
> None taken, but I always think that it is the language's job to
> express my thoughts...

I don't.  In fact whenever I investigate new languages I make an
effort to accommodate its thinking, I find I learn a lot more than I
would by  it into my preconceived thinking.  YMMV.


> I don't like to think that my thoughts are
> somehow constrained by the language.

And yet your previous thoughts seem oddly constrained by Perl....


If you really want a language that can accommodate any thought you
could possibly have, you should check out Lisp.

(defmacro swap (a b)
  '(let ((t1 ,a)
         (t2 ,b))
     (setq ,b t1)
     (setq ,a t2)))

hygiene-left-as-an-exercise-ly yr's,


Carl Banks
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to