[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18. Utility Functions

Utility functions provide some usuful functions to access to the system and to process strings.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.0.1 util_filter

util_filter(Command,Input)

: It executes the filter program Command with the Input and returns the output of the filter as a string.

util_filter(Command,Input | env=key0)

: This function allows optional variables env

Example:

 
 util_filter("sort","cat\ndog\ncentipede\n");

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.0.2 util_find_and_replace

util_find_and_replace(W,S,Wnew)

: It replaces W in S by Wnew. Arguments must be a list of ascii codes.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.0.3 util_find_substr

util_find_substr(W,S)

: It returns the position of W in S. If W cannot be found, it returns -1. Arguments must be a list of ascii codes.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.0.4 util_index

util_index(V)

: It returns the name part and the index part of V.

Example:

 
 util_index(x_2_3)

References:

util_v


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.0.5 util_load_file_as_a_string

util_load_file_as_a_string(F)

: It reads a file F as a string.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.0.6 util_part

util_part(S,P,Q)

: It returns from Pth element to Qth element of S.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.0.7 util_read_file_as_a_string

util_read_file_as_a_string(F)

: It reads a file F as a string.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.0.8 util_remove_cr

util_remove_cr(S)

: It removes cr/lf/tabs from S. Arguments must be a list of ascii codes.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.0.9 util_timing

util_timing(Q)

: Show the timing data to execute Q.

Example:

 
 util_timing( quote( fctr(x^50-y^50) ));

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.0.10 util_v

util_v(V,L)

: It returns a variable indexed by L.

Example:

 
 util_v("x",[1,3]);

References:

util_index


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18.0.11 util_write_string_to_a_file

util_write_string_to_a_file(Fname,S)

: It writes a string S to a file Fname.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by Nobuki Takayama on January, 28 2008 using texi2html 1.76.