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
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
List nit (Score:1)
Reply to This
Re: (Score:1)
That's why you have quoting... er... that's why function application only applies to the first element of a cons... er... that's why you have Lisp-2... er... sigils are ugly, darnit.
Re: (Score:1)
(let ((foo '(1 and 2)))
`(this is a new list with
That evaluates to (this is a new list with 1 and 2 in it). It amuses me anyway
Re: (Score:1)
(defun foo (a b) (- a b)) (let ((foo (lambda (a b) (+ a b)))) (foo 2 1) ; 1 (funcall foo 2 1)) ; 3Oh well, you can't have everything.Re: (Score:1)
Re: (Score:1)
... not for the compiler anyway. Some of the rest of us like to optimize for the slower parts of the process, often known as wetware.
Re: (Score:1)
sub foo {}
my $foo = sub {};
foo();
$foo->();
my $foo = "hello";
$foo->(); # death
Anyway, lisp is what it is. It's straightforward to write a macro such that:
(with-sigils (&foo) (foo $foo))
expands to
(progn (funcall foo) (foo foo)))
If you really care I'll try it out and blog the code
Re: (Score:1)