From: Slobodan Blazeski
Subject: Why  push doesn't work with  hash-tables?
Date: 
Message-ID: <1193871118.403999.150550@19g2000hsx.googlegroups.com>
What's the reason that  (push (gethash key hash-table) val)  is not
specified?

cheers
Slobodan

From: Carl Taylor
Subject: Re: Why  push doesn't work with  hash-tables?
Date: 
Message-ID: <uR7Wi.309129$ax1.218564@bgtnsc05-news.ops.worldnet.att.net>
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
From: Slobodan Blazeski
Subject: Re: Why push doesn't work with hash-tables?
Date: 
Message-ID: <1193873332.424858.79160@50g2000hsm.googlegroups.com>
Thanks to both of you,  stupid mistake of my side.

Slobodan
From: Gene
Subject: Re: Why push doesn't work with hash-tables?
Date: 
Message-ID: <1193877705.443718.75910@d55g2000hsg.googlegroups.com>
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?
From: Espen Vestre
Subject: Re: Why push doesn't work with hash-tables?
Date: 
Message-ID: <m18x5ii97p.fsf@gazonk.vestre.net>
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)
From: Thomas F. Burdick
Subject: Re: Why push doesn't work with hash-tables?
Date: 
Message-ID: <1193917024.332954.253020@22g2000hsm.googlegroups.com>
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".
From: Gene
Subject: Re: Why push doesn't work with hash-tables?
Date: 
Message-ID: <1193974989.026796.137730@50g2000hsm.googlegroups.com>
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")