Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Crate for creating semantic thingy
Former "smodel", now called hydroperx::sem
, can be used in compiler infrastructures to designate symbol ("thingy") hierarchies with ease.
.clean()
after long processes for forgetting one-reference-count garbages.Weak<__data__::Thingy>
, where __data__::Thingy
can further be something like __data__::Thingy { variant: __data__::ThingyVariant::Variable { variant: __data__::VariableVariant::__Nothing, x: 0.0 } }
.match
yourself over "variants"; you use override fn
, .is::<T>()
or .to::<T>()
, and may declare instance variables.super();
prefix in constructors.super.m()
expression.Limitations:
sem!
macro got no way to split itself into different files for now. However I see the tendency that the classes tend to be vague if you implement some operations in separate Rust modules.Bugfixes:
Unlisted advantages:
.is
and .to
, though).Implementing metavars in a compiler uses the technique of using a replacement field rather than mutating a thingy' instance itself, thus operations like equality must be mostly structural rather than referential.
1 post - 1 participant
🏷️ rust_feed