Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
example-06-multiple-inheritance
===============================

The classic diamond:

        A
       / \
      B   C
       \ /
        D

`D` extends both `B` and `C`. The program prints D's method-lookup order
(D, B, C, A, ObjectClass) and shows that an instance variable declared
on A is a single shared slot in D — never doubled up. Also exercises
`is_kind_of` against every level of the hierarchy.

Build / run / clean
-------------------
Run any of these from this directory:

    make build
    make run
    make clean

Equivalent cargo commands from the workspace root (Dynace-RS/):

    cargo build -p example-06-multiple-inheritance
    cargo run   -p example-06-multiple-inheritance
    cargo clean -p example-06-multiple-inheritance

The built executable
--------------------
After a build, the standalone binary lives at:

    <workspace-root>/target/debug/example-06-multiple-inheritance

(or `target/release/...` if built with `cargo build --release`). It's a
normal native executable that links only to libc and libgcc_s, so you can
copy or move it anywhere on a compatible system and run it directly.

Using this as a starter project
-------------------------------
This directory is self-contained — you can copy it anywhere on your
machine and use it as the seed for your own application:

    cp -r <Dynace-RS>/examples/06-multiple-inheritance ~/my-app

Then open the copied `Cargo.toml` and adjust the `dynace` dependency
path to point at wherever Dynace-RS lives on your system, e.g.:

    dynace = { path = "/abs/path/to/Dynace-RS/crates/dynace" }
    dynace = { git = "https://github.com/your-user/Dynace-RS.git" }

After that, `make build` / `make run` / `make clean` work as usual,
and the resulting binary lands in `target/debug/...` of your copied
project.