Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
»

process

os.process

:
orderable
 is
[Contains abstract features]
[Private constructor]
type denoting a started process

Fields

Functions

 => 
String
[Inherited from  Any]
[Contains abstract features]
create a String from this instance. Unless redefined, `a.as_string` will
create `"instance[T]"` where `T` is the dynamic type of `a`
 => 
outcome unit
[Contains abstract features]
close standard input of this process
 => 
Type
[Inherited from  Any]
[Contains abstract features]
Get the dynamic type of this instance. For value instances `x`, this is
equal to `type_of x`, but for `x` with a `ref` type `x.dynamic_type` gives
the actual runtime type, while `type_of x` results in the static
compile-time type.

There is no dynamic type of a type instance since this would result in an
endless hierarchy of types. So for Type values, dynamic_type is redefined
to just return Type.type.
(process_and_args Sequence String)
 => 
outcome os.process
[Contains abstract features]
pipe this processes output to new process
 => 
String
[Inherited from  Any]
[Contains abstract features]
convenience prefix operator to create a string from a value.

This permits usage of `$` as a prefix operator in a similar way both
inside and outside of constant strings: $x and "$x" will produce the
same string.
(sig os.this.signal)
 => 
outcome unit
[Contains abstract features]
send signal to processm
 => 
outcome u32
[Contains abstract features]
wait for this process
(T 
type
, LM 
type
:
mutate, f Function (outcome T))
 => 
outcome T
[Contains abstract features]
install buffered reader for reading from stdout of process
and run `f`.
(T 
type
, LM 
type
:
mutate, f Function T)
 => 
outcome T
[Contains abstract features]
(T 
type
, LM 
type
:
mutate, f Function (outcome T))
 => 
outcome T
[Contains abstract features]
install buffered reader for reading from stdout of process
and run `f`.
(bytes Sequence u8)
 => 
outcome i32
[Contains abstract features]
write bytes to stdin of child process
(s String)
 => 
outcome i32
[Contains abstract features]
write string to stdin of child process

Type Functions

 => 
String
[Inherited from  Type]
[Contains abstract features]
string representation of this type to be used for debugging.

result has the form "Type of '<name>'", but this might change in the future

redefines:

 => 
Type
[Inherited from  Type]
[Contains abstract features]
There is no dynamic type of a type instance since this would result in an
endless hierarchy of types, so dynamic_type is redefined to just return
Type.type here.

redefines:

(a os.process.this.type, b os.process.this.type)
 => 
bool
[Contains abstract features]
equality
(T 
type
)
 => 
bool
[Inherited from  Type]
[Contains abstract features]
Is this type assignable to a type parameter with constraint `T`?

The result of this is a compile-time constant that can be used to specialize
code for a particular type.

is_of_integer_type(n T : numeric) => T : integer
say (is_of_integer_type 1234) # true
say (is_of_integer_type 3.14) # false

it is most useful in conjunction preconditions or `if` statements as in

pair(a,b T) is
same
pre T : property.equatable
=>
a = b

or

val(n T) is

# check if T is numeric, if so
# return true if n > zero,
# return nil if T is not numeric
#
more_than_zero option bool =>
if T : numeric then
n > T.zero
else
nil
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
(a os.process.this.type, b os.process.this.type)
 => 
bool
[Contains abstract features]
lteq
 => 
String
[Inherited from  Type]
[Contains abstract features]
name of this type, including type parameters, e.g. 'option (list i32)'.
 => 
String
[Inherited from  Type]
[Contains abstract features]
convenience prefix operator to create a string from a value.

This permits usage of `$` as a prefix operator in a similar way both
inside and outside of constant strings: $x and "$x" will produce the
same string.

NYI: Redefinition allows the type feature to be distinguished from its normal counterpart, see #3913

redefines:

(n String)
 => 
outcome os.process
[Contains abstract features]
start a process with name and no arguments
(n String, args Sequence String)
 => 
outcome os.process
[Contains abstract features]
start a process with name and arguments
(n String, args Sequence String, env_vars container.Map String String)
 => 
outcome os.process
[Contains abstract features]
start a process with name, arguments and environment variables
 => 
Type
[Inherited from  Any]
[Contains abstract features]
Get a type as a value.

This is a feature with the effect equivalent to Fuzion's `expr.type` call tail.
It is recommended to use `expr.type` and not `expr.type_value`.

`type_value` is here to show how this can be implemented and to illustrate the
difference to `dynamic_type`.
0.094dev (2025-06-18 15:08:51 GIT hash 89cffc23ae669b0898a5564fefbf793fcb8e5ca7 built by fridi@fzen)