Library functions and utilities


Defines

#define enable_pickle(F)   static bool script_register_##F = ::dynamic::internal::register_function(#F, (void*)&F);

Functions

DYNAMIC_API var dynamic::global ()
 Access the global object (for global variables).
DYNAMIC_API var dynamic::version ()
 Retrieves the version-string of the library.
DYNAMIC_API var dynamic::bind (const var &fn, const var &arg)
 Takes a functor (fn) and returns a functor taking fewer arguments.
DYNAMIC_API var dynamic::object ()
 Creates an empty object (a container mapping strings to values).
DYNAMIC_API var dynamic::object (const char *class_name)
 Creates an empty object with a specified name.
DYNAMIC_API var dynamic::string_from (const var &container)
 Creates a string with elements from another container.
template<typename FwdIterator >
var dynamic::string_it (FwdIterator from, FwdIterator to)
 Creates a string with elements assigned from the iterators.
DYNAMIC_API std::string dynamic::pickle (const var &)
 Converts most vars to a string.
DYNAMIC_API var dynamic::unpickle (const std::string &)
 Converts a string from pickle() back into a var.
DYNAMIC_API var dynamic::tail (const var &container)
 Removes the first element of a container.
DYNAMIC_API var dynamic::map ()
 Creates an empty map.
DYNAMIC_API var dynamic::map (const var &key, const var &value)
 Creates a map with one key-value pair.
DYNAMIC_API var dynamic::set ()
 Creates an empty set.
DYNAMIC_API var dynamic::set (const var &)
 Creates a set with one element.
DYNAMIC_API var dynamic::set (const var &, const var &)
 Creates a set with given elements.
DYNAMIC_API var dynamic::set (const var &, const var &, const var &)
 Creates a set with given elements.
DYNAMIC_API var dynamic::set (const var &, const var &, const var &, const var &)
 Creates a set with given elements.
DYNAMIC_API var dynamic::set (const var &, const var &, const var &, const var &, const var &)
 Creates a set with given elements.
DYNAMIC_API var dynamic::set (const var &, const var &, const var &, const var &, const var &, const var &)
 Creates a set with given elements.
DYNAMIC_API var dynamic::set (const var &, const var &, const var &, const var &, const var &, const var &, const var &)
 Creates a set with given elements.
DYNAMIC_API var dynamic::set (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &)
 Creates a set with given elements.
DYNAMIC_API var dynamic::set (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &)
 Creates a set with given elements.
DYNAMIC_API var dynamic::set (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &)
 Creates a set with given elements.
DYNAMIC_API var dynamic::set_from (const var &container)
 Creates a set with elements populated from another container.
template<typename FwdIterator >
var dynamic::set_it (FwdIterator start, FwdIterator end)
 Creates a set with elements populated from the two iterators.
DYNAMIC_API var dynamic::fill_array (const var &size, const var &item)
 Creates an array of given size containing the same item.
DYNAMIC_API var dynamic::array ()
 Creates an empty array.
DYNAMIC_API var dynamic::array (const var &)
 Creates an array with a single element.
DYNAMIC_API var dynamic::array (const var &, const var &)
 Creates an array with two elements.
DYNAMIC_API var dynamic::array (const var &, const var &, const var &)
 Creates an array with three elements.
DYNAMIC_API var dynamic::array (const var &, const var &, const var &, const var &)
 Creates an array with given elements.
DYNAMIC_API var dynamic::array (const var &, const var &, const var &, const var &, const var &)
 Creates an array with given elements.
DYNAMIC_API var dynamic::array (const var &, const var &, const var &, const var &, const var &, const var &)
 Creates an array with given elements.
DYNAMIC_API var dynamic::array (const var &, const var &, const var &, const var &, const var &, const var &, const var &)
 Creates an array with given elements.
DYNAMIC_API var dynamic::array (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &)
 Creates an array with given elements.
DYNAMIC_API var dynamic::array (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &)
 Creates an array with given elements.
DYNAMIC_API var dynamic::array (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &)
 Creates an array with given elements.
DYNAMIC_API var dynamic::array_from (const var &)
 Creates an array with elements from another container.
template<typename It >
var dynamic::array_it (It a, It b)
 Creates an array with elements between the iterators.
template<std::size_t N>
var dynamic::array (var(&l)[N])
 Creates an array from a C-style array.
DYNAMIC_API var dynamic::list ()
 Creates an empty list.
DYNAMIC_API var dynamic::fill_list (const var &size, const var &item)
 Creates a list of given size containing the specified item.
template<typename It >
var dynamic::list_it (It a, It b)
 Creates a list from elements between a pair of iterators.
DYNAMIC_API var dynamic::list (const var &item)
 Creates a list containing a single item.
DYNAMIC_API var dynamic::list (const var &, const var &)
 Creates a list containing given items.
DYNAMIC_API var dynamic::list (const var &, const var &, const var &)
 Creates a list containing given items.
DYNAMIC_API var dynamic::list (const var &, const var &, const var &, const var &)
 Creates a list containing given items.
DYNAMIC_API var dynamic::list (const var &, const var &, const var &, const var &, const var &)
 Creates a list containing given items.
DYNAMIC_API var dynamic::list (const var &, const var &, const var &, const var &, const var &, const var &)
 Creates a list containing given items.
DYNAMIC_API var dynamic::list (const var &, const var &, const var &, const var &, const var &, const var &, const var &)
 Creates a list containing given items.
DYNAMIC_API var dynamic::list (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &)
 Creates a list containing given items.
DYNAMIC_API var dynamic::list (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &)
 Creates a list containing given items.
DYNAMIC_API var dynamic::list (const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &, const var &)
 Creates a list containing given items.
DYNAMIC_API var dynamic::list_from (const var &container)
 Creates a list containing elements from a given container.
template<std::size_t N>
var dynamic::list (var(&ca)[N])
 Creates a list with elements from a C-style array.
DYNAMIC_API var dynamic::range (const var &from, const var &to)
 Creates sequences.
DYNAMIC_API var dynamic::range (const var &from, const var &to, const var &step)
 Creates sequences.
DYNAMIC_API var dynamic::range_ex (const var &from, const var &to)
 Creates sequences.
DYNAMIC_API var dynamic::range_ex (const var &from, const var &to, const var &step)
 Creates sequences.
DYNAMIC_API var dynamic::sequence (const var &start, const var &len)
 Creates sequences.
DYNAMIC_API var dynamic::sequence (const var &start, const var &len, const var &step)
 Creates sequences.
DYNAMIC_API var dynamic::reverse (const var &)
 Creates a container with its elements reversed.
DYNAMIC_API var dynamic::filter (const var &container, const var &pred)
 Creates a container which filters the contents of another container using a predicate.
DYNAMIC_API var dynamic::transform (const var &container, const var &fn)
 Creates a container which transforms the elements of another container.
DYNAMIC_API var dynamic::dispatcher (const var &object)
 Creates a dispatcher object.
DYNAMIC_API var dynamic::max (const var &a, const var &b)
 Returns the larger of a or b.
DYNAMIC_API var dynamic::min (const var &a, const var &b)
 Returns the smaller of a or b.
DYNAMIC_API var dynamic::open_file (const var &filename, std::ios_base::openmode flags)
 Opens the file and returns a file object.
DYNAMIC_API var dynamic::write_file (const var &filename)
 Opens a file for write.
DYNAMIC_API var dynamic::read_file (const var &filename)
 Opens a file for reading.
DYNAMIC_API var dynamic::fstat (const var &filename)
 Returns status information about a file.
DYNAMIC_API var dynamic::in ()
 Returns the file for standard input.
DYNAMIC_API var dynamic::out ()
 Returns the file for standard output.
DYNAMIC_API var dynamic::err ()
 Returns the file for standard errors.
DYNAMIC_API var dynamic::mem_file ()
 Creates an in-memory file.
DYNAMIC_API var dynamic::characters (const var &file)
 Enumerates through all characters in a file.
DYNAMIC_API var dynamic::lines (const var &file)
 Enumerates through all lines in a file.
DYNAMIC_API var dynamic::enumerate (const var &fn)
 Enumerates any function until it returns null.
DYNAMIC_API void dynamic::write (const var &)
 Writes a string to standard output.
DYNAMIC_API void dynamic::writeln (const var &)
 Writes a string to standard output, followed by new line.
DYNAMIC_API void dynamic::writeln ()
 Writes a new line to standard output.
DYNAMIC_API var dynamic::readln ()
 Reads a new line from standard input.
DYNAMIC_API void dynamic::pickle_file (const var &name, const var &object)
 Pickles an object into a file.
DYNAMIC_API var dynamic::unpickle_file (const var &name)
 Reads an object file a file.
DYNAMIC_API void dynamic::sleep (const var &seconds)
 Pauses the current thread for the given interval.
DYNAMIC_API var dynamic::system (const var &)
 Executes a system call.
DYNAMIC_API var dynamic::thread (const var &thread_fn)
 Creates a thread, and executes the given functor in the thread.
DYNAMIC_API var dynamic::global (const var &fn)
 Executes the given functor in a globally-shared apartment.
DYNAMIC_API var dynamic::shared (const var &fn)
 Executes the given functor in a new apartment.
DYNAMIC_API var dynamic::event ()
 Creates a event object.
DYNAMIC_API var dynamic::mutex ()
 Creates a mutex object.
DYNAMIC_API var dynamic::exec (const var &file, const var &args)
 Executes the given command (does not return).
DYNAMIC_API var dynamic::queue ()
 Creates a queue object.
DYNAMIC_API var dynamic::message_queue (const var &consumer, const var &threads=1)
 Creates a message queue object, with a given consumer functor running in the specified number of threads.
DYNAMIC_API var dynamic::substring (const var &str, const var &range)
 Returns a substring of a string.
DYNAMIC_API var dynamic::split_chars (var predicate, var str)
 Splits the string and returns an array of strings matching the predicate.
DYNAMIC_API var dynamic::string_find (const var &str, const var &needle)
 Returns the range of the first occurrence of a particular string, or null.
DYNAMIC_API var dynamic::string_find_last (const var &str, const var &needle)
 Returns the range of the last occurrance of a particular string, or null.
DYNAMIC_API var dynamic::string_find_all (const var &str, const var &needle)
 Returns an array of ranges.
DYNAMIC_API var dynamic::pad (const var &str, const var &size)
 Returns a string of a fixed size by truncating it or padding it with spaces.
DYNAMIC_API var dynamic::is_space (var ch)
 Returns true if ch is a space.
DYNAMIC_API var dynamic::is_one_of (var str, var ch)
 Returns true if ch appears in str.
DYNAMIC_API var dynamic::is_not_one_of (var str, var ch)
 Returns false if ch appears in str.
DYNAMIC_API var dynamic::is_not (var predicate, var value)
 Negates the given predicate.
DYNAMIC_API var dynamic::varargs (const var &fn)
 Returns a functor taking a variable number of arguments.
DYNAMIC_API var dynamic::run_tests (const var &tests)
 Executes all tests in the map tests.
DYNAMIC_API double dynamic::timer ()
 Returns the time in seconds since the start of the program.

Variables

const var dynamic::null
 The null value, same as var().

Define Documentation

#define enable_pickle (  )     static bool script_register_##F = ::dynamic::internal::register_function(#F, (void*)&F);

Definition at line 542 of file lib.hpp.


Function Documentation

template<std::size_t N>
var dynamic::array ( var(&)  l[N]  )  [inline]

Creates an array from a C-style array.

Definition at line 229 of file lib.hpp.

References dynamic::array(), dynamic::var::impl(), dynamic::internal::var_methods< Derived, Deref >::push_back(), and dynamic::var_impl::reserve().

var dynamic::array ( const var &  a0,
const var &  a1,
const var &  a2,
const var &  a3,
const var &  a4,
const var &  a5,
const var &  a6,
const var &  a7,
const var &  a8,
const var &  a9 
)

Creates an array with given elements.

Definition at line 225 of file array.cpp.

References dynamic::array(), dynamic::var::impl(), dynamic::internal::var_methods< Derived, Deref >::push_back(), and dynamic::var_impl::reserve().

var dynamic::array ( const var &  a0,
const var &  a1,
const var &  a2,
const var &  a3,
const var &  a4,
const var &  a5,
const var &  a6,
const var &  a7,
const var &  a8 
)

Creates an array with given elements.

Definition at line 208 of file array.cpp.

References dynamic::array(), dynamic::var::impl(), dynamic::internal::var_methods< Derived, Deref >::push_back(), and dynamic::var_impl::reserve().

var dynamic::array ( const var &  a0,
const var &  a1,
const var &  a2,
const var &  a3,
const var &  a4,
const var &  a5,
const var &  a6,
const var &  a7 
)

Creates an array with given elements.

Definition at line 192 of file array.cpp.

References dynamic::array(), dynamic::var::impl(), dynamic::internal::var_methods< Derived, Deref >::push_back(), and dynamic::var_impl::reserve().

var dynamic::array ( const var &  a0,
const var &  a1,
const var &  a2,
const var &  a3,
const var &  a4,
const var &  a5,
const var &  a6 
)

Creates an array with given elements.

Definition at line 177 of file array.cpp.

References dynamic::array(), dynamic::var::impl(), dynamic::internal::var_methods< Derived, Deref >::push_back(), and dynamic::var_impl::reserve().

var dynamic::array ( const var &  a0,
const var &  a1,
const var &  a2,
const var &  a3,
const var &  a4,
const var &  a5 
)

Creates an array with given elements.

Definition at line 163 of file array.cpp.

References dynamic::array(), dynamic::var::impl(), dynamic::internal::var_methods< Derived, Deref >::push_back(), and dynamic::var_impl::reserve().

var dynamic::array ( const var &  a0,
const var &  a1,
const var &  a2,
const var &  a3,
const var &  a4 
)

Creates an array with given elements.

Definition at line 150 of file array.cpp.

References dynamic::array(), dynamic::var::impl(), dynamic::internal::var_methods< Derived, Deref >::push_back(), and dynamic::var_impl::reserve().

var dynamic::array ( const var &  a0,
const var &  a1,
const var &  a2,
const var &  a3 
)

Creates an array with given elements.

Definition at line 138 of file array.cpp.

References dynamic::array(), dynamic::var::impl(), dynamic::internal::var_methods< Derived, Deref >::push_back(), and dynamic::var_impl::reserve().

var dynamic::array ( const var &  a0,
const var &  a1,
const var &  a2 
)

Creates an array with three elements.

Definition at line 127 of file array.cpp.

References dynamic::array(), dynamic::var::impl(), dynamic::internal::var_methods< Derived, Deref >::push_back(), and dynamic::var_impl::reserve().

var dynamic::array ( const var &  a0,
const var &  a1 
)

var dynamic::array ( const var &  a0  ) 

Creates an array with a single element.

Definition at line 108 of file array.cpp.

References dynamic::array(), dynamic::var::impl(), dynamic::internal::var_methods< Derived, Deref >::push_back(), and dynamic::var_impl::reserve().

var dynamic::array (  ) 

var dynamic::array_from ( const var &  other  ) 

Creates an array with elements from another container.

Definition at line 256 of file array.cpp.

References dynamic::array(), and dynamic::internal::var_methods< Derived, Deref >::push_back().

Referenced by test_array().

template<typename It >
var dynamic::array_it ( It  a,
It  b 
) [inline]

Creates an array with elements between the iterators.

Definition at line 217 of file lib.hpp.

References dynamic::array(), dynamic::var::impl(), dynamic::internal::var_methods< Derived, Deref >::push_back(), and dynamic::var_impl::reserve().

Referenced by test_array().

var dynamic::bind ( const var &  fn,
const var &  arg 
)

Takes a functor (fn) and returns a functor taking fewer arguments.

Definition at line 890 of file libdynamic/functor.cpp.

References dynamic::internal::var_methods< Derived, Deref >::max_args().

Referenced by dynamic::unpickler::read_object(), test_function(), test_native(), test_scopeguard(), and test_string_functions().

var dynamic::characters ( const var &  file  ) 

Enumerates through all characters in a file.

Definition at line 331 of file stream.cpp.

References dynamic::enumerate().

Referenced by test_files().

var dynamic::dispatcher ( const var &  object  ) 

Creates a dispatcher object.

Definition at line 385 of file libdynamic/dispatcher.cpp.

Referenced by dynamic::unpickler::read_object().

var dynamic::enumerate ( const var &  fn  ) 

Enumerates any function until it returns null.

Definition at line 626 of file iterators.cpp.

Referenced by dynamic::characters(), and dynamic::lines().

var dynamic::err (  ) 

Returns the file for standard errors.

Definition at line 277 of file stream.cpp.

References dynamic::internal::var_methods< Derived, Deref >::extend(), dynamic::object(), dynamic::write(), and dynamic::writeln().

Referenced by test_files().

var dynamic::event (  ) 

Creates a event object.

Definition at line 99 of file threads.cpp.

var dynamic::exec ( const var &  file,
const var &  args 
)

var dynamic::fill_array ( const var &  size,
const var &  item 
)

DYNAMIC_API var dynamic::fill_list ( const var &  size,
const var &  item 
)

Creates a list of given size containing the specified item.

var dynamic::filter ( const var &  container,
const var &  pred 
)

Creates a container which filters the contents of another container using a predicate.

Definition at line 608 of file iterators.cpp.

Referenced by test_transform().

var dynamic::fstat ( const var &  filename  ) 

Returns status information about a file.

Definition at line 295 of file stream.cpp.

References dynamic::internal::var_methods< Derived, Deref >::as_string(), dynamic::internal::var_methods< Derived, Deref >::extend(), and dynamic::object().

Referenced by test_files().

var dynamic::global ( const var &  fn  ) 

Executes the given functor in a globally-shared apartment.

Definition at line 1707 of file proxy.cpp.

Referenced by test_global().

var dynamic::global (  ) 

Access the global object (for global variables).

Definition at line 206 of file script.cpp.

var dynamic::in (  ) 

Returns the file for standard input.

Definition at line 286 of file stream.cpp.

References dynamic::internal::var_methods< Derived, Deref >::extend(), dynamic::object(), and cin::readln().

Referenced by dynamic::read_file(), and test_files().

var dynamic::is_not ( var  predicate,
var  value 
)

Negates the given predicate.

Definition at line 332 of file lib.cpp.

var dynamic::is_not_one_of ( var  str,
var  ch 
)

Returns false if ch appears in str.

Definition at line 326 of file lib.cpp.

References dynamic::is_one_of().

Referenced by test_string_functions().

var dynamic::is_one_of ( var  str,
var  ch 
)

Returns true if ch appears in str.

Definition at line 319 of file lib.cpp.

Referenced by dynamic::is_not_one_of(), and test_string_functions().

var dynamic::is_space ( var  ch  ) 

Returns true if ch is a space.

Definition at line 313 of file lib.cpp.

References dynamic::internal::var_methods< Derived, Deref >::as_int().

Referenced by test_string_functions().

var dynamic::lines ( const var &  file  ) 

Enumerates through all lines in a file.

Definition at line 337 of file stream.cpp.

References dynamic::enumerate().

Referenced by test_files().

template<std::size_t N>
var dynamic::list ( var(&)  ca[N]  )  [inline]

Creates a list with elements from a C-style array.

Definition at line 303 of file lib.hpp.

References dynamic::list(), and dynamic::internal::var_methods< Derived, Deref >::push_back().

Referenced by test_list(), test_proxy(), test_reverse(), test_set(), and test_string_container().

var dynamic::list ( const var &  i0,
const var &  i1,
const var &  i2,
const var &  i3,
const var &  i4,
const var &  i5,
const var &  i6,
const var &  i7,
const var &  i8,
const var &  i9 
)

Creates a list containing given items.

Definition at line 157 of file list.cpp.

References dynamic::list().

var dynamic::list ( const var &  i0,
const var &  i1,
const var &  i2,
const var &  i3,
const var &  i4,
const var &  i5,
const var &  i6,
const var &  i7,
const var &  i8 
)

Creates a list containing given items.

Definition at line 151 of file list.cpp.

References dynamic::list().

var dynamic::list ( const var &  i0,
const var &  i1,
const var &  i2,
const var &  i3,
const var &  i4,
const var &  i5,
const var &  i6,
const var &  i7 
)

Creates a list containing given items.

Definition at line 145 of file list.cpp.

References dynamic::list().

var dynamic::list ( const var &  i0,
const var &  i1,
const var &  i2,
const var &  i3,
const var &  i4,
const var &  i5,
const var &  i6 
)

Creates a list containing given items.

Definition at line 139 of file list.cpp.

References dynamic::list().

var dynamic::list ( const var &  i0,
const var &  i1,
const var &  i2,
const var &  i3,
const var &  i4,
const var &  i5 
)

Creates a list containing given items.

Definition at line 133 of file list.cpp.

References dynamic::list().

var dynamic::list ( const var &  i0,
const var &  i1,
const var &  i2,
const var &  i3,
const var &  i4 
)

Creates a list containing given items.

Definition at line 127 of file list.cpp.

References dynamic::list().

var dynamic::list ( const var &  i0,
const var &  i1,
const var &  i2,
const var &  i3 
)

Creates a list containing given items.

Definition at line 121 of file list.cpp.

References dynamic::list().

var dynamic::list ( const var &  i0,
const var &  i1,
const var &  i2 
)

Creates a list containing given items.

Definition at line 115 of file list.cpp.

References dynamic::list().

var dynamic::list ( const var &  i0,
const var &  i1 
)

Creates a list containing given items.

Definition at line 109 of file list.cpp.

References dynamic::list().

var dynamic::list ( const var &  item  ) 

Creates a list containing a single item.

Definition at line 103 of file list.cpp.

References dynamic::list().

var dynamic::list (  ) 

Creates an empty list.

Definition at line 97 of file list.cpp.

Referenced by dynamic::list(), dynamic::list_from(), dynamic::list_it(), and dynamic::queue().

var dynamic::list_from ( const var &  container  ) 

Creates a list containing elements from a given container.

Definition at line 163 of file list.cpp.

References dynamic::list(), and dynamic::internal::var_methods< Derived, Deref >::push_back().

Referenced by test_list().

template<typename It >
var dynamic::list_it ( It  a,
It  b 
) [inline]

Creates a list from elements between a pair of iterators.

Definition at line 248 of file lib.hpp.

References dynamic::list(), and dynamic::internal::var_methods< Derived, Deref >::push_back().

Referenced by test_list().

var dynamic::map ( const var &  key,
const var &  value 
)

Creates a map with one key-value pair.

Definition at line 89 of file map.cpp.

References dynamic::map().

Referenced by test_map(), test_proxy(), test_set(), and test_test_framework().

var dynamic::map (  ) 

Creates an empty map.

Definition at line 83 of file map.cpp.

Referenced by dynamic::map().

var dynamic::max ( const var &  a,
const var &  b 
)

Returns the larger of a or b.

Definition at line 152 of file lib.cpp.

Referenced by test_libs().

var dynamic::mem_file (  ) 

Creates an in-memory file.

Definition at line 261 of file stream.cpp.

References dynamic::internal::var_methods< Derived, Deref >::extend().

Referenced by test_files().

var dynamic::message_queue ( const var &  consumer,
const var &  threads = 1 
)

Creates a message queue object, with a given consumer functor running in the specified number of threads.

Definition at line 100 of file libdynamic/queue.cpp.

References dynamic::array(), dynamic::internal::var_methods< Derived, Deref >::extend(), dynamic::internal::var_methods< Derived, Deref >::push_back(), dynamic::queue(), and dynamic::thread().

Referenced by test_queue().

var dynamic::min ( const var &  a,
const var &  b 
)

Returns the smaller of a or b.

Definition at line 158 of file lib.cpp.

Referenced by test_libs().

var dynamic::mutex (  ) 

Creates a mutex object.

Definition at line 118 of file threads.cpp.

References dynamic::internal::var_methods< Derived, Deref >::extend(), and dynamic::object().

Referenced by test_threads().

var dynamic::object ( const char *  class_name  ) 

var dynamic::object (  ) 

Creates an empty object (a container mapping strings to values).

Definition at line 255 of file object.cpp.

Referenced by dynamic::err(), dynamic::fstat(), dynamic::in(), dynamic::mutex(), dynamic::out(), and dynamic::queue().

var dynamic::open_file ( const var &  filename,
std::ios_base::openmode  flags 
)

Opens the file and returns a file object.

Definition at line 235 of file stream.cpp.

References dynamic::internal::var_methods< Derived, Deref >::as_string(), and dynamic::internal::var_methods< Derived, Deref >::extend().

Referenced by test_files().

var dynamic::out (  ) 

Returns the file for standard output.

Definition at line 268 of file stream.cpp.

References dynamic::internal::var_methods< Derived, Deref >::extend(), dynamic::object(), dynamic::write(), and dynamic::writeln().

Referenced by test_files(), and dynamic::write_file().

var dynamic::pad ( const var &  str,
const var &  size 
)

Returns a string of a fixed size by truncating it or padding it with spaces.

Definition at line 344 of file lib.cpp.

References dynamic::internal::var_methods< Derived, Deref >::as_string(), and dynamic::internal::var_methods< Derived, Deref >::resize().

std::string dynamic::pickle ( const var &  v  ) 

void dynamic::pickle_file ( const var &  name,
const var &  object 
)

Pickles an object into a file.

Definition at line 313 of file stream.cpp.

References dynamic::pickle(), and dynamic::write_file().

Referenced by test_files().

var dynamic::queue (  ) 

Creates a queue object.

Definition at line 89 of file libdynamic/queue.cpp.

References dynamic::internal::var_methods< Derived, Deref >::extend(), dynamic::list(), and dynamic::object().

Referenced by dynamic::message_queue().

var dynamic::range ( const var &  from,
const var &  to,
const var &  step 
)

var dynamic::range ( const var &  from,
const var &  to 
)

var dynamic::range_ex ( const var &  from,
const var &  to,
const var &  step 
)

var dynamic::range_ex ( const var &  from,
const var &  to 
)

Creates sequences.

Definition at line 362 of file range.cpp.

References dynamic::internal::var_methods< Derived, Deref >::as_int().

var dynamic::read_file ( const var &  file  ) 

Opens a file for reading.

Reads an entire file into a single string.

Definition at line 248 of file stream.cpp.

References dynamic::internal::var_methods< Derived, Deref >::as_string(), dynamic::internal::var_methods< Derived, Deref >::extend(), and dynamic::in().

Referenced by test_files(), and dynamic::unpickle_file().

var dynamic::readln (  ) 

Reads a new line from standard input.

Definition at line 19 of file stream.cpp.

References dynamic::null.

Referenced by dynamic::in(), and test_files().

var dynamic::reverse ( const var &  container  ) 

var dynamic::run_tests ( const var &  tests  ) 

Executes all tests in the map tests.

Definition at line 186 of file lib.cpp.

References dynamic::writeln().

Referenced by test_test_framework().

var dynamic::sequence ( const var &  start,
const var &  len,
const var &  step 
)

Creates sequences.

Definition at line 392 of file range.cpp.

References dynamic::internal::var_methods< Derived, Deref >::as_int().

Referenced by test_sequence().

var dynamic::sequence ( const var &  start,
const var &  len 
)

var dynamic::set ( const var &  a0,
const var &  a1,
const var &  a2,
const var &  a3,
const var &  a4,
const var &  a5,
const var &  a6,
const var &  a7,
const var &  a8,
const var &  a9 
)

Creates a set with given elements.

Definition at line 305 of file libdynamic/set.cpp.

Referenced by test_tls().

var dynamic::set ( const var &  a0,
const var &  a1,
const var &  a2,
const var &  a3,
const var &  a4,
const var &  a5,
const var &  a6,
const var &  a7,
const var &  a8 
)

Creates a set with given elements.

Definition at line 299 of file libdynamic/set.cpp.

var dynamic::set ( const var &  a0,
const var &  a1,
const var &  a2,
const var &  a3,
const var &  a4,
const var &  a5,
const var &  a6,
const var &  a7 
)

Creates a set with given elements.

Definition at line 293 of file libdynamic/set.cpp.

var dynamic::set ( const var &  a0,
const var &  a1,
const var &  a2,
const var &  a3,
const var &  a4,
const var &  a5,
const var &  a6 
)

Creates a set with given elements.

Definition at line 287 of file libdynamic/set.cpp.

var dynamic::set ( const var &  a0,
const var &  a1,
const var &  a2,
const var &  a3,
const var &  a4,
const var &  a5 
)

Creates a set with given elements.

Definition at line 281 of file libdynamic/set.cpp.

var dynamic::set ( const var &  a0,
const var &  a1,
const var &  a2,
const var &  a3,
const var &  a4 
)

Creates a set with given elements.

Definition at line 275 of file libdynamic/set.cpp.

var dynamic::set ( const var &  a0,
const var &  a1,
const var &  a2,
const var &  a3 
)

Creates a set with given elements.

Definition at line 269 of file libdynamic/set.cpp.

var dynamic::set ( const var &  a0,
const var &  a1,
const var &  a2 
)

Creates a set with given elements.

Definition at line 263 of file libdynamic/set.cpp.

var dynamic::set ( const var &  a0,
const var &  a1 
)

Creates a set with given elements.

Definition at line 257 of file libdynamic/set.cpp.

var dynamic::set ( const var &  a  ) 

Creates a set with one element.

Definition at line 251 of file libdynamic/set.cpp.

var dynamic::set (  ) 

Creates an empty set.

Definition at line 245 of file libdynamic/set.cpp.

Referenced by dynamic::apartment::enter().

var dynamic::set_from ( const var &  container  ) 

Creates a set with elements populated from another container.

Definition at line 311 of file libdynamic/set.cpp.

References dynamic::internal::var_methods< Derived, Deref >::insert().

Referenced by test_set().

template<typename FwdIterator >
var dynamic::set_it ( FwdIterator  start,
FwdIterator  end 
) [inline]

Creates a set with elements populated from the two iterators.

Definition at line 155 of file lib.hpp.

References dynamic::internal::var_methods< Derived, Deref >::insert().

Referenced by test_set().

var dynamic::shared ( const var &  fn  ) 

Executes the given functor in a new apartment.

Definition at line 1701 of file proxy.cpp.

Referenced by dynamic::pickler::write_object().

void dynamic::sleep ( const var &  seconds  ) 

Pauses the current thread for the given interval.

Definition at line 111 of file threads.cpp.

References dynamic::internal::var_methods< Derived, Deref >::as_int(), and dynamic::api::sleep().

var dynamic::split_chars ( var  predicate,
var  str 
)

Splits the string and returns an array of strings matching the predicate.

Definition at line 282 of file lib.cpp.

References dynamic::array(), and dynamic::internal::var_methods< Derived, Deref >::push_back().

Referenced by test_string_functions().

var dynamic::string_find ( const var &  str,
const var &  needle 
)

Returns the range of the first occurrence of a particular string, or null.

Definition at line 239 of file lib.cpp.

References dynamic::null, dynamic::sequence(), and dynamic::internal::var_methods< Derived, Deref >::size().

Referenced by test_string_functions().

var dynamic::string_find_all ( const var &  str,
const var &  needle 
)

var dynamic::string_find_last ( const var &  str,
const var &  needle 
)

Returns the range of the last occurrance of a particular string, or null.

Definition at line 252 of file lib.cpp.

References dynamic::null, dynamic::sequence(), and dynamic::internal::var_methods< Derived, Deref >::size().

Referenced by test_string_functions().

var dynamic::string_from ( const var &  container  ) 

Creates a string with elements from another container.

Definition at line 279 of file string.cpp.

References dynamic::internal::var_methods< Derived, Deref >::push_back().

Referenced by test_string_container().

template<typename FwdIterator >
var dynamic::string_it ( FwdIterator  from,
FwdIterator  to 
) [inline]

Creates a string with elements assigned from the iterators.

Definition at line 77 of file lib.hpp.

References dynamic::internal::var_methods< Derived, Deref >::push_back().

Referenced by test_string_container().

var dynamic::substring ( const var &  str,
const var &  range 
)

var dynamic::system ( const var &  cmd  ) 

Executes a system call.

Definition at line 15 of file lib.cpp.

References dynamic::internal::var_methods< Derived, Deref >::as_string().

var dynamic::tail ( const var &  container  ) 

Removes the first element of a container.

Definition at line 620 of file iterators.cpp.

Referenced by test_tail().

var dynamic::thread ( const var &  thread_fn  ) 

Creates a thread, and executes the given functor in the thread.

Definition at line 105 of file threads.cpp.

Referenced by dynamic::message_queue(), test_stack_trace(), and test_threads().

double dynamic::timer (  ) 

Returns the time in seconds since the start of the program.

Definition at line 338 of file lib.cpp.

var dynamic::transform ( const var &  container,
const var &  fn 
)

Creates a container which transforms the elements of another container.

Definition at line 614 of file iterators.cpp.

Referenced by dynamic::exec(), and test_transform().

var dynamic::unpickle ( const std::string &  s  ) 

var dynamic::unpickle_file ( const var &  name  ) 

Reads an object file a file.

Todo:
Read directly from stream

Definition at line 321 of file stream.cpp.

References dynamic::internal::var_methods< Derived, Deref >::as_string(), dynamic::read_file(), and dynamic::unpickle().

Referenced by test_files().

var dynamic::varargs ( const var &  fn  ) 

Returns a functor taking a variable number of arguments.

Definition at line 1177 of file libdynamic/functor.cpp.

Referenced by test_proxy().

var dynamic::version (  ) 

Retrieves the version-string of the library.

Todo:
Avoid hard-coding this here

Definition at line 240 of file script.cpp.

void dynamic::write ( const var &  v  ) 

Writes a string to standard output.

Definition at line 36 of file stream.cpp.

Referenced by dynamic::err(), dynamic::out(), and test_files().

var dynamic::write_file ( const var &  filename  ) 

void dynamic::writeln (  ) 

Writes a new line to standard output.

Definition at line 30 of file stream.cpp.

Referenced by dynamic::err(), dynamic::out(), and test_files().

void dynamic::writeln ( const var &  v  ) 

Writes a string to standard output, followed by new line.

Definition at line 13 of file stream.cpp.

Referenced by dynamic::run_tests().


Variable Documentation

const var dynamic::null


Generated on Thu Dec 18 22:14:18 2008 for C++Script by  doxygen 1.5.7.1