Post Scarcity
A prototype for a post scarcity programming environment
Loading...
Searching...
No Matches
hashmap.h File Reference
Include dependency graph for hashmap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DFLT_HASHMAP_BUCKETS   32
 

Functions

struct cons_pointer lisp_get_hash (struct stack_frame *frame, struct cons_pointer frame_pointer, struct cons_pointer env)
 A lisp function signature conforming wrapper around get_hash, q.v.
 
struct cons_pointer lisp_hashmap_put (struct stack_frame *frame, struct cons_pointer frame_pointer, struct cons_pointer env)
 Expects frame->arg[1] to be a hashmap or namespace; frame->arg[2] to be a string-like-thing (perhaps necessarily a keyword); frame->arg[3] to be any value.
 
struct cons_pointer lisp_hashmap_put_all (struct stack_frame *frame, struct cons_pointer frame_pointer, struct cons_pointer env)
 Lisp function expecting two arguments, a hashmap and an assoc list.
 
struct cons_pointer lisp_make_hashmap (struct stack_frame *frame, struct cons_pointer frame_pointer, struct cons_pointer env)
 Lisp funtion of up to four args (all optional), where.
 

Macro Definition Documentation

◆ DFLT_HASHMAP_BUCKETS

#define DFLT_HASHMAP_BUCKETS   32

Definition at line 18 of file hashmap.h.

Function Documentation

◆ lisp_get_hash()

struct cons_pointer lisp_get_hash ( struct stack_frame frame,
struct cons_pointer  frame_pointer,
struct cons_pointer  env 
)

A lisp function signature conforming wrapper around get_hash, q.v.

Definition at line 25 of file hashmap.c.

References get_hash(), make_integer(), and NIL.

Referenced by main().

◆ lisp_hashmap_put()

struct cons_pointer lisp_hashmap_put ( struct stack_frame frame,
struct cons_pointer  frame_pointer,
struct cons_pointer  env 
)

Expects frame->arg[1] to be a hashmap or namespace; frame->arg[2] to be a string-like-thing (perhaps necessarily a keyword); frame->arg[3] to be any value.

If current user is authorised to write to this hashmap, modifies the hashmap and returns it; if not, clones the hashmap, modifies the clone, and returns that.

Definition at line 106 of file hashmap.c.

References hashmap_put(), and pointer2cell.

Referenced by main().

◆ lisp_hashmap_put_all()

struct cons_pointer lisp_hashmap_put_all ( struct stack_frame frame,
struct cons_pointer  frame_pointer,
struct cons_pointer  env 
)

Lisp function expecting two arguments, a hashmap and an assoc list.

Copies all key/value pairs from the assoc list into the map.

Definition at line 126 of file hashmap.c.

References hashmap_put_all().

Referenced by main().

◆ lisp_make_hashmap()

struct cons_pointer lisp_make_hashmap ( struct stack_frame frame,
struct cons_pointer  frame_pointer,
struct cons_pointer  env 
)

Lisp funtion of up to four args (all optional), where.

first is expected to be an integer, the number of buckets, or nil; second is expected to be a hashing function, or nil; third is expected to be an assocable, or nil; fourth is a list of user tokens, to be used as a write ACL, or nil.

Definition at line 39 of file hashmap.c.

References authorised(), c_car(), c_cdr(), c_string_to_lisp_string(), DFLT_HASHMAP_BUCKETS, functionp, get_hash(), integerp, make_cons(), make_exception(), make_hashmap(), NIL, nilp, vector_space_object::payload, pointer_to_vso, to_long_int(), and truep.

Referenced by main().