Back to index

texmacs  1.0.7.15
Functions
assoc_environment.cpp File Reference
#include "assoc_environment.hpp"

Go to the source code of this file.

Functions

assoc_environment copy (assoc_environment env)
int weak_hash (assoc_environment env)
bool weak_equal (assoc_environment env1, assoc_environment env2)

Function Documentation

Definition at line 76 of file assoc_environment.cpp.

                             {
  int i, n= env->n;
  assoc_environment r (n);
  for (i=0; i<n; i++)
    r->raw_write (i, env->a[i].key, env->a[i].val);
  return r;
}
bool weak_equal ( assoc_environment  env1,
assoc_environment  env2 
)

Definition at line 98 of file assoc_environment.cpp.

                                                            {
  int i, n= env1->n;
  if (env2->n != n) return false;
  assoc_node* a1= env1->a;
  assoc_node* a2= env2->a;
  for (i=0; i<n; i++)
    if (a1[i].key != a2[i].key || !weak_equal (a1[i].val, a2[i].val))
      return false;
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 89 of file assoc_environment.cpp.

                                  {
  int i, n= env->n, h=0;
  assoc_node* a= env->a;
  for (i=0; i<n; i++)
    h= (h<<1) ^ (h>>31) ^ a[i].key ^ (weak_hash (a[i].val)<<2);
  return h;
}

Here is the call graph for this function:

Here is the caller graph for this function: