[Coldstuff] [coldcore] @settings

Brandon Gillespie coldstuff@cold.org
Wed, 05 Jun 2002 23:01:37 -0600


Jon A. Lambert wrote:
> In ColdCore, what's the philosophy behind @settings?
> Is it just to provide a consistent "manageable" public interface to 
> user definable settings?  Or is there some performance/size benefit 
> to using dictionaries as opposed to global vars?

its to have a single user interface for managing configuration 
variables.  Its actually slower, not faster than global vars.

> And some more questions... 
> 
> Is there any easy way to take documents embedded with oodles of 
> HTML and have it format correctly (that is word wrap intelligently) 
> on both a plain text terminal and a browser-type interface?

You can use CML for some of it.

> What's the ColdC idiom for doing substitutions/translations
> on text?  strsed() or simply iterating through strings using a 
> state machine and dictionary?   Is there a translation method 
> already done in the core that takes a dictionary and a string
> and builds a translated string?  

There are many ways of doing it.  strsed, strsub are both top level 
replacements; you can also parse the string yourself with many different 
mechanisms.  For string parsing, ColdC has kindof taken the perl 
approach: provide many different options, let the programmer pick the 
one they like the most.

-Brandon