Slobodan Blazeski wrote:
> What's the reason that (push (gethash key hash-table) val) is not
> specified?
It is, but your syntax is a bit off.
Carl Taylor
CL-USER 1 >
(let ((ht (make-hash-table :size 101)))
(loop for n below 100
do (push (* n n) (gethash n ht)))
(loop repeat 5
do (print (gethash (random 100) ht))))
(25)
(3136)
(5329)
(4761)
(3600)
NIL
On Oct 31, 7:28 pm, Slobodan Blazeski <·················@gmail.com>
wrote:
> Thanks to both of you, stupid mistake of my side.
>
> Slobodan
Stupid perl-ism, probably...
our @lst;
push @lst, 1, 2, 3;
Not?
Gene <············@gmail.com> writes:
>> Thanks to both of you, stupid mistake of my side.
>>
>> Slobodan
>
> Stupid perl-ism, probably...
Well, there's no reason to bash other programming languages for
/this/. CL isn't exactly great when it comes to argument order, just
think of ELT vs. NTH....
The important message to the OP is: ALWAYS use whatever command your
lisp environment has for displaying the argument list of the function
you're typing!
--
(espen)
On Nov 1, 10:52 am, Espen Vestre <·····@vestre.net> wrote:
> Gene <············@gmail.com> writes:
> >> Thanks to both of you, stupid mistake of my side.
>
> >> Slobodan
>
> > Stupid perl-ism, probably...
>
> Well, there's no reason to bash other programming languages for
> /this/. CL isn't exactly great when it comes to argument order, just
> think of ELT vs. NTH....
>
> The important message to the OP is: ALWAYS use whatever command your
> lisp environment has for displaying the argument list of the function
> you're typing!
I'd add, if "(foo<space>" isn't one way of seeing the arguments to
FOO, you should fix your environment so it is. With a proper
environment, this shortcoming of CL should take about 100 ms of
programmer-time to work around, flicking your eyes towards the arglist
to spot "place".
On Nov 1, 5:52 am, Espen Vestre <·····@vestre.net> wrote:
> Gene <············@gmail.com> writes:
> >> Thanks to both of you, stupid mistake of my side.
>
> >> Slobodan
>
> > Stupid perl-ism, probably...
>
> Well, there's no reason to bash other programming languages for
> /this/. CL isn't exactly great when it comes to argument order, just
> think of ELT vs. NTH....
>
> The important message to the OP is: ALWAYS use whatever command your
> lisp environment has for displaying the argument list of the function
> you're typing!
Sorry. No disrespect intended. I meant the error might be due to
habits formed in perl coding. I like perl.
From: Edi Weitz
Subject: Re: Why push doesn't work with hash-tables?
Date:
Message-ID: <ulk9ihozr.fsf@agharta.de>
On Wed, 31 Oct 2007 15:51:58 -0700, Slobodan Blazeski <·················@gmail.com> wrote:
> What's the reason that (push (gethash key hash-table) val) is not
> specified?
Try it the other way around.
CL-USER 1 > (let ((hash (make-hash-table)))
(push 42 (gethash 1 hash))
(gethash 1 hash))
(42)
T
Edi.
--
Lisp is not dead, it just smells funny.
Real email: (replace (subseq ·········@agharta.de" 5) "edi")