pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   // -*- Pike -*-   //   // Master Control Program for Pike.   //   // This file is part of Pike. For copyright information see COPYRIGHT.   // Pike is distributed under GPL, LGPL and MPL. See the file COPYING   // for more information.   // - // $Id: master.pike.in,v 1.443 2008/06/10 12:43:17 mast Exp $ + // $Id: master.pike.in,v 1.444 2008/06/24 12:44:46 mast Exp $      #pike __REAL_VERSION__   //#pragma strict_types      // Some programs destroys character pairs beginning with the currency   // symbol when running in chinese locale.   #if "ยค/" != "\244/"   #error "master.pike.in is corrupted."   #endif   
pike.git/lib/master.pike.in:674:      //! Namespaces for compat masters.   //!   //! This inherit is used to provide compatibility namespaces   //! for @[get_compat_master()].   //!   //! @seealso   //! @[get_compat_master()]   static inherit Pike_7_6_master;    + class CompatAllConstants (mapping(string:mixed) compat_overrides) + // Wrapper for the mapping returned by all_constants in compat mode. + { +  static mixed `[] (string sym) +  { +  mixed val = compat_overrides[sym]; +  if (zero_type (val)) val = predef::all_constants()[sym]; +  return val; +  } +  static mixed `-> (string sym) +  {return `[] (sym);} +  +  static mixed `[]= (string sym, mixed val) +  {return predef::all_constants()[sym]= val;} +  static mixed `->= (string sym, mixed val) +  {return `[]= (sym, val);} +  +  static array(string) _indices() +  {return indices (predef::all_constants() | compat_overrides);} +  static array(mixed) _values() +  {return values (predef::all_constants() | compat_overrides);} +  +  static mapping `+ (mapping other) +  {return (predef::all_constants() | compat_overrides) + other;} +  static mapping ``+ (mapping other) +  {return other + (predef::all_constants() | compat_overrides);} +  static mapping `| (mapping other) +  {return (predef::all_constants() | compat_overrides) | other;} +  static mapping ``| (mapping other) +  {return other | (predef::all_constants() | compat_overrides);} + } +    //! @appears error   //! Throws an error. A more readable version of the code   //! @expr{throw( ({ sprintf(f, @@args), backtrace() }) )@}.   void error(string f, mixed ... args) {    if (sizeof(args)) f = sprintf(f, @args);    throw( ({ f, backtrace()[..<1] }) );   }      // FIXME: Should the pikeroot-things be private?   #ifdef PIKE_FAKEROOT