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.
  • "list" is already a function name, so I wouldn't use it as a variable. This wouldn't happen if the language had sigils...
    • This isn't a problem. Symbols get their values from different "slots" depending on context. When you write (list 'foo 'bar), list is called as a function. When you write (setq list 42) and then (+ list list), you get 84. It's very clear. The only problem is calling a function saved in the value slot of a symbol: (defun foo (a b) (- a b)) (let ((foo (lambda (a b) (+ a b)))) (foo 2 1) ; 1 (funcall foo 2 1)) ; 3 Oh well, you can't have everything.
      • Disclaimer: the last Lisp I used was AutoLisp...many years ago. I don't remember if it behaved the way you describe or not. I later (after posting) figured this wouldn't be a problem in this instance anyway because "list" was (dynamically?) scoped to the function. But I still don't think I'd call a variable "list" in the language (w/o sigils) :-)