Back to index

texmacs  1.0.7.15
Classes | Defines | Functions
environment.hpp File Reference
#include "tree.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  environment_rep
class  environment

Defines

#define ALTERNATIVE_MACRO_EXPANSION

Functions

int weak_hash (tree t)
bool weak_equal (tree t1, tree t2)
int round_pow2 (int i)
 ABSTRACT_NULL_CODE (environment)
void test_environments ()

Define Documentation

Definition at line 17 of file environment.hpp.


Function Documentation

int round_pow2 ( int  i) [inline]

Definition at line 37 of file environment.hpp.

                   {
  int n=1;
  while (n<i) n <<= 1;
  return n;
}

Definition at line 428 of file std_environment.cpp.

                     {
  assoc_environment a1= assoc (6, "Sylvie", 9, "Nicole");
  assoc_environment a2= assoc (9, "Joris");
  assoc_environment a3= assoc (21, "Judith");
  assoc_environment a4= assoc (9, "Judith", 6, "Tessa");
  assoc_environment a5= assoc (9, "Piet", 21, "Joris");

  basic_environment b1= test_environment (23, 1234567);
  std_environment std1= primitive_environment (b1);
  std1->print (""); cout << HRULE;
  std1->accel->print (""); cout << HRULE;
  std_environment std2= begin_with_environment (std1, a1);
  std2->print (""); cout << HRULE;
  std2->accel->print (""); cout << HRULE;
  std_environment std3= assign_environment (std2, a5);
  std3->print (""); cout << HRULE;
  std3->accel->print (""); cout << HRULE;
  std_environment std4= assign_environment (std3, a3);
  std4->print (""); cout << HRULE;
  std4->accel->print (""); cout << HRULE;
  std_environment std5= begin_with_environment (std4, a4);
  std5->print (""); cout << HRULE;
  std5->accel->print (""); cout << HRULE;
  std_environment std6= assign_environment (std5, a2);
  std6->print (""); cout << HRULE;
  std6->accel->print (""); cout << HRULE;
  for (int i=0; i<10; i++)
    cout << i << "\t" << std6->read (i) << "\n";
  cout << HRULE;
  std6->accel->print (""); cout << HRULE;
  for (int i=0; i<10; i++)
    cout << i << "\t" << std6->read (i) << "\n";
  cout << HRULE;
  std6->accel->print (""); cout << HRULE;
  for (int i=0; i<40; i++)
    cout << i << "\t" << std6->read (i) << "\n";
  cout << HRULE;
  std6->accel->print (""); cout << HRULE;
  std_environment std7= end_with_environment (std6);
  std7->print (""); cout << HRULE;
  std7->accel->print (""); cout << HRULE;
  std_environment std8= end_with_environment (std7);
  std8->print (""); cout << HRULE;
  std8->accel->print (""); cout << HRULE;
}

Here is the call graph for this function:

bool weak_equal ( tree  t1,
tree  t2 
) [inline]

Definition at line 30 of file environment.hpp.

                              {
  tree_rep* rep1= t1.operator -> ();
  tree_rep* rep2= t2.operator -> ();
  return rep1 == rep2;
}
int weak_hash ( tree  t) [inline]

Definition at line 24 of file environment.hpp.

                   {
  tree_rep* rep= t.operator -> ();
  return hash ((void*) rep);
}

Here is the call graph for this function: