18. Backward Compatibility

  Pike is a language under active development. This can lead to incompatibilities between different versions of Pike. To alleviate this problem Pike has a backward compatibility layer.

  The backward compatibility layer can be engaged in two ways; either by starting the Pike interpreter with the `-V` option, or by using the `#pike` preprocessor directive.

  The backward compatibility layer affects both the compiler and the available modules.

  The remainder of this chapter describes the main incompatibilities between the various versions of Pike and the current version.

18.1. Pike 7.6

18.1.1. Global Functions

18.1.2. Modules

  The following modules and functions have moved or been renamed:

  7.6::Image.colortable | Image.Colortable
  7.6::Image.font | Image.Font
  7.6::Image.image | Image.Image
  7.6::_Charset | Locale.Charset.module
  7.6::spider.isbasechar() | Parser.XML.isbasechar()
  7.6::spider.iscombiningchar() | Parser.XML.iscombiningchar()
  7.6::spider.isdigit() | Parser.XML.isdigit()
  7.6::spider.isextender() | Parser.XML.isextender()
  7.6::spider.isfirstnamechar() | Parser.XML.isfirstnamechar()
  7.6::spider.ishexchar() | Parser.XML.ishexchar()
  7.6::spider.isidographic() | Parser.XML.isidographic()
  7.6::spider.isletter() | Parser.XML.isletter()
  7.6::spider.isnamechar() | Parser.XML.isnamechar()
  7.6::spider.isspace() | Parser.XML.ispace()

18.1.3. Compiler

18.2. Pike 7.4

18.2.1. SQL Headerfiles

  Pike 7.4 had some SQL-related headerfiles `msql.h`, `mysql.h` and `postgres.h` that just performed `import` of the corresponding module, and nothing else.

18.2.2. Modules

  7.4::Standards.PKCS.Signature.build_digest() used to expect a 7.4::Crypto.md5 -style hash object as the second argument.

  The lifetime for the Stdio.Fd object used by a 7.4::Stdio.File object could differ from the lifetime of the using object. This could in theory cause problems for code that uses Stdio.File()->dup() or Stdio.File()->assign() .

  Destructing a locked 7.4::Thread.Mutex object had the effect of also destructing the corresponding key object.

  7.4::Tools.Standalone.extract_autodoc had a different argument list.

  7.4::explode_path() splitted a string on `/` on all systems except NT, where it spitted on both `/` and `\`.

  The following modules and functions have moved, been renamed or been deleted:

  7.4::ADT.Heap()->top() | ADT.Heap()->pop()
  7.4::Crypto | (deprecated by Nettle )
  7.4::_Crypto | (deprecated by Nettle )
  7.4::Locale.Charset.ascii | (deprecated by Locale.Charset.ASCIIDec )
  7.4::Locale.Charset._encoder | Locale.Charset.Encoder
  7.4::Protocols.SMTP.protocol | Protocols.SMTP.Protocol
  7.4::Protocols.SMTP.client | Protocols.SMTP.Client
  7.4::Protocols.SMTP.client()->reply_codes | Protocols.SMTP.replycodes
  7.4::Regexp | Regexp.SimpleRegexp
  7.4::Sql.sql | Sql.Sql
  7.4::Standards.ASN1.Encode | (deprecated by Standards.ASN1.Types )
  7.4::rusage() | (deprecated by System.getrusage )
  7.4::hash() | hash_7_4()
  7.4::call_with_creds() | __builtin.security.call_with_creds()
  7.4::get_current_creds() | __builtin.security.get_current_creds()
  7.4::get_object_creds() | __builtin.security.get_object_creds()
  7.4::_pipe_debug() | Pipe._pipe_debug()
  7.4::getpwent() | System.getpwent()
  7.4::endpwent() | System.endpwent()
  7.4::setpwent() | System.setpwent()
  7.4::getgrent() | System.getgrent()
  7.4::endgrent() | System.endgrent()
  7.4::setgrent() | System.getgrent()

18.2.3. Compiler

18.3. Pike 7.2

18.3.1. Modules

  7.2::Parser.XML.Simple , 7.2::Parser.XML.Validating as well as 7.2::Parser.XML.Tree.parse_input() used to be more lenient.

  Most functions in 7.2::Protocols.LDAP.client used to have different calling conventions.

  7.2::Thread.Condition()->wait() used to support being called without a Thread.Mutex . This support was removed since it introduced race-conditions in almost all code that used the feature.

  7.2::dirname() used to return `""` for the path `"/"`.

  7.2::new() and 7.2::clone() have been obsoleted by `((program)prog)(@args)`.

  The following modules and functions have moved, been renamed or been deleted:

  7.2::Gmp.pow | pow
  7.2::LR | Parser.LR
  7.2::LR.item | Parser.LR.Parser.Item (protected)
  7.2::LR.parser | Parser.LR.Parser
  7.2::LR.priority | Parser.LR.Priority
  7.2::LR.rule | Parser.LR.Rule
  7.2::LR.scanner | (deleted)
  7.2::String.strmult | (deprecated by `* )
  7.2::String.String_buffer | (deprecated by String.Buffer )
  7.2::system | System
  7.2::sleep | delay
  7.2::default_yp_domain | Yp.default_domain
  7.2::_low_program_name | spider._low_program_name
  7.2::set_start_quote | spider.set_start_quote
  7.2::set_end_quote | spider.set_end_quote
  7.2::parse_accessed_database | spider.parse_accessed_database
  7.2::_dump_obj_table | spider._dump_obj_table
  7.2::parse_html | spider.parse_html
  7.2::parse_html_lines | spider.parse_html_lines
  7.2::discdate | spider.discdate
  7.2::stardate | spider.stardate
  7.2::get_all_active_fd | spider.get_all_active_fd
  7.2::fd_info | spider.fd_info

18.3.2. Compiler

18.4. Pike 7.0

18.4.1. Simulate

  `#include` of `<simulate.h>` or import of the 7.0::Simulate module provided some compatibility with LPC.

  The compatibility functions were 7.0::Simulate.member_array() , 7.0::Simulate.previous_object() , 7.0::Simulate.this_function() , 7.0::Simulate.get_function() , 7.0::Simulate.map_regexp() as well was various functions from the Array , String and Process modules.

  The following functions were provided under alternate names:

  7.0::Simulate.all_efuns | all_constants
  7.0::Simulate.explode | `/
  7.0::Simulate.filter_array | filter
  7.0::Simulate.map_array | map
  7.0::Simulate.implode | `*
  7.0::Simulate.m_indices | indices
  7.0::Simulate.m_sizeof | sizeof
  7.0::Simulate.m_values | values
  7.0::Simulate.strstr | search
  7.0::Simulate.sum | `+
  7.0::Simulate.add_efun | add_constant
  7.0::Simulate.l_sizeof | sizeof
  7.0::Simulate.listp | multisetp
  7.0::Simulate.mklist | mkmultiset
  7.0::Simulate.aggregate_list | aggregate_multiset
  7.0::Simulate.query_host_name | gethostname

  A single mathematical constant was also provided; 7.0::Simulate.PI with a value close to `3.1415926535897932384626433832795080`.

18.4.2. Modules

  The 7.0::Colors module contained lots of color definitions with three-element arrays containing the Red, Green and Blue components. These color definitions are now provided by the Image.Colors module.

  7.0::Stdio.File()->stat() and 7.0::Stdio.FILE()->stat() as well as 7.2::file_stat() used to return an array with integers and not a Stdio.Stat object.

  7.0::_typeof() used to return a string and not a type.

  7.0::m_delete() used to return the mapping and not the deleted value.

  The following modules and functions have moved or been renamed:

  7.0::Calendar | Calendar_I
  7.0::hash | hash_7_0
  7.0::Stack.stack | ADT.Stack

18.4.3. Compiler

18.5. Pike 0.6

18.5.1. Laxer Types

  Several functions, including 0.6::Array.map and 0.6::aggregate , had much more lenient types than in later versions.

18.5.2. readline

  There was a global function 0.6::readline() that provided some simple readline support. This was obsoleted by the Readline module.