comparison src/fns.c @ 25080:46c21258f1ff

(Fgethash): Fix order of variables (patch by gerd). (Fputhash): Ditto. (Fremhash): Ditto.
author Markus Rost <rost@math.uni-bielefeld.de>
date Mon, 26 Jul 1999 22:20:21 +0000
parents 31cd7d7a54df
children 30bfdf581d6f
comparison
equal deleted inserted replaced
25079:3a09aae52441 25080:46c21258f1ff
4367 4367
4368 4368
4369 DEFUN ("gethash", Fgethash, Sgethash, 2, 3, 0, 4369 DEFUN ("gethash", Fgethash, Sgethash, 2, 3, 0,
4370 "Look up KEY in TABLE and return its associated value.\n\ 4370 "Look up KEY in TABLE and return its associated value.\n\
4371 If KEY is not found, return DFLT which defaults to nil.") 4371 If KEY is not found, return DFLT which defaults to nil.")
4372 (table, key, dflt) 4372 (key, table, dflt)
4373 Lisp_Object table, key; 4373 Lisp_Object key, table;
4374 { 4374 {
4375 struct Lisp_Hash_Table *h = check_hash_table (table); 4375 struct Lisp_Hash_Table *h = check_hash_table (table);
4376 int i = hash_lookup (h, key, NULL); 4376 int i = hash_lookup (h, key, NULL);
4377 return i >= 0 ? HASH_VALUE (h, i) : dflt; 4377 return i >= 0 ? HASH_VALUE (h, i) : dflt;
4378 } 4378 }
4380 4380
4381 DEFUN ("puthash", Fputhash, Sputhash, 3, 3, 0, 4381 DEFUN ("puthash", Fputhash, Sputhash, 3, 3, 0,
4382 "Associate KEY with VALUE is hash table TABLE.\n\ 4382 "Associate KEY with VALUE is hash table TABLE.\n\
4383 If KEY is already present in table, replace its current value with\n\ 4383 If KEY is already present in table, replace its current value with\n\
4384 VALUE.") 4384 VALUE.")
4385 (table, key, value) 4385 (key, value, table)
4386 Lisp_Object table, key, value; 4386 Lisp_Object key, value, table;
4387 { 4387 {
4388 struct Lisp_Hash_Table *h = check_hash_table (table); 4388 struct Lisp_Hash_Table *h = check_hash_table (table);
4389 int i; 4389 int i;
4390 unsigned hash; 4390 unsigned hash;
4391 4391
4399 } 4399 }
4400 4400
4401 4401
4402 DEFUN ("remhash", Fremhash, Sremhash, 2, 2, 0, 4402 DEFUN ("remhash", Fremhash, Sremhash, 2, 2, 0,
4403 "Remove KEY from TABLE.") 4403 "Remove KEY from TABLE.")
4404 (table, key) 4404 (key, table)
4405 Lisp_Object table, key; 4405 Lisp_Object key, table;
4406 { 4406 {
4407 struct Lisp_Hash_Table *h = check_hash_table (table); 4407 struct Lisp_Hash_Table *h = check_hash_table (table);
4408 hash_remove (h, key); 4408 hash_remove (h, key);
4409 return Qnil; 4409 return Qnil;
4410 } 4410 }