<commit_before>// Copyright (c) 2012, <NAME> <<EMAIL>>

abstract class Environment {

  /** The internal environment bindings. */
  final Map<Symbol, Dynamic> _bindings;

  /** Constructor for the environment. */
  Environment() : _bindings = new Map();

  /** Constructor for a nested environment. */
  Environment create() => new NestedEnvironment(this);

  /** Returns the cell defined by a [key]. */
  Dynamic operator [](Symbol key) {
    var value = _bindings[key];
    return value != null ? value : _notFound(key);
  }

  /** Defines or redefines the cell with [value] of a [key]. */
  void operator []=(Symbol key, Dynamic value) {
    _bindings[key] = value;
  }

  /** Abstract behavior called when an non-existing binding is accessed. */
  abstract Dynamic _notFound(Symbol key);

}

class RootEnvironment extends Environment {

  /** Return null if the value does not exist. */
  _notFound(Symbol key) => null;

  /** Register the minimal functions needed for bootstrap. */
  RootEnvironment() {

    /** Defines a value in the root environment. */
    _define('define', (Environment env, Dynamic args) {
      return this[args.head] = eval(env, args.tail.head);
    });

    /** Looks up a native function. */
    _define('native', (Environment env, Dynamic args) {
      return Natives.find(args.head);
    });

  }

  /** Private function to define primitives. */
  _define(String key, Dynamic cell) {
    this[new Symbol(key)] = cell;
  }

}

class NestedEnvironment extends Environment {

  /** The owning environemnt. */
  final Environment _owner;

  /** Constructs a nested environment. */
  NestedEnvironment(this._owner);

  /** Lookup values in the parent environment. */
  _notFound(Symbol key) => _owner[key];

}<commit_msg>- fixed comment in environment<commit_after>// Copyright (c) 2012, <NAME> <<EMAIL>>

abstract class Environment {

  /** The internal environment bindings. */
  final Map<Symbol, Dynamic> _bindings;

  /** Constructor for the environment. */
  Environment() : _bindings = new Map();

  /** Constructor for a nested environment. */
  Environment create() => new NestedEnvironment(this);

  /** Returns the cell defined by a [key]. */
  Dynamic operator [](Symbol key) {
    var value = _bindings[key];
    return value != null ? value : _notFound(key);
  }

  /** Defines or redefines the cell with [value] of a [key]. */
  void operator []=(Symbol key, Dynamic value) {
    _bindings[key] = value;
  }

  /** Abstract behavior called when an non-existing binding is accessed. */
  abstract Dynamic _notFound(Symbol key);

}

class RootEnvironment extends Environment {

  /** Return null if the value does not exist. */
  _notFound(Symbol key) => null;

  /** Register the minimal functions needed for bootstrap. */
  RootEnvironment() {

    /** Defines a value in the root environment. */
    _define('define', (Environment env, Dynamic args) {
      return this[args.head] = eval(env, args.tail.head);
    });

    /** Lookup a native function. */
    _define('native', (Environment env, Dynamic args) {
      return Natives.find(args.head);
    });

  }

  /** Private function to define primitives. */
  _define(String key, Dynamic cell) {
    this[new Symbol(key)] = cell;
  }

}

class NestedEnvironment extends Environment {

  /** The owning environemnt. */
  final Environment _owner;

  /** Constructs a nested environment. */
  NestedEnvironment(this._owner);

  /** Lookup values in the parent environment. */
  _notFound(Symbol key) => _owner[key];

}
{'fraction_non_alphanumeric': 0.13115220483641538, 'fraction_numerical': 0.002275960170697013, 'mean_word_length': 3.2825822168087697, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1756869', 'n_tokens_mistral': 1041, 'n_tokens_neox': 980, 'n_words': 345}