Overview
simple_env provides SCOOP-compatible environment variable access for Eiffel applications. Unlike the standard EXECUTION_ENVIRONMENT, it uses direct Win32 API calls with inline C for reliable, thread-safe environment manipulation.
Part of the Simple Eiffel ecosystem.
Quick Start
Installation
- Set the environment variable:
export SIMPLE_EIFFEL=/d/prod - Add to your ECF file:
<library name="simple_env" location="$SIMPLE_EIFFEL/simple_env/simple_env.ecf"/>
Basic Usage
local
env: SIMPLE_ENV
do
create env
-- Get a variable
if attached env.get ("PATH") as path then
print (path)
end
-- Set a variable
env.set ("MY_VAR", "my_value")
-- Expand paths
print (env.expand ("%USERPROFILE%\Documents"))
end
Key Features
Get & Set
Read, write, and delete environment variables with simple API.
String Expansion
Expand %VAR% references in paths and strings.
Enumeration
List all variables or filter by prefix.
SCOOP Safe
Designed for concurrent programming with no shared state.
API Summary
Access
get (name)- Get variable value (Void if not set)item [name]- Array-style access (alias for get)has (name)- Check if variable exists
Modification
set (name, value)- Set environment variableput (value, name)- Set (HASH_TABLE convention)unset (name)- Remove environment variable
Expansion
expand (string)- Expand %VAR% references
Enumeration
all_names- All environment variable namesnames_with_prefix (prefix)- Variables matching prefix
Why simple_env?
vs. EXECUTION_ENVIRONMENT
| Feature | EXECUTION_ENVIRONMENT | SIMPLE_ENV |
|---|---|---|
| SCOOP compatible | No (internal caching) | Yes (no shared state) |
| String expansion | No | Yes (%VAR% support) |
| Enumerate variables | No | Yes (all_names, prefix filter) |
| Operation status | No | Yes (last_operation_succeeded) |
Documentation
- User Guide - Complete tutorial with examples
- API Reference - Full API documentation
- Architecture - Internal design and Win32 integration
- Cookbook - Ready-to-use recipes