_model_name(m: function): text

m must be a model (i.e. the value of a variable defined in the import clause of a model).  The result will be one full path for m in the Vesta repository.

from /vesta/vestasys.org/vesta import
  eval/4;
{
  n = _model_name(eval);

  // n == "/vesta/vestasys.org/vesta/eval/4/build.ves"
}

Note that if the same model exists in an identical directory with a different path, that path can be returned even if that is not the path which was used to import m.  (This happens fairly often, as a checked in version is usually identical to the last snapshot taken with vadvance. See the diagram in the vcheckin man page.)

from /vesta/foobar.com/project import
  package/12;
{
  n = _model_name(package);

  // n == "/vesta/foobar.com/project/package/12/build.ves"
  //   OR
  // n == "/vesta/foobar.com/project/package/checkout/12/23/build.ves"
}

_model_name is probably most useful in conjunction with the "_self" special variable.

Take care when using _model_name, as it can introduce dependencies into your build which will cause re-evaluation that may not be necessary.

_fingerprint(v: any): text

Returns a text representation of v's fingerprint.  A fingerprint is a 128-bit value which is chosen such that the probability of two different values having the same fingerprint is very low.  However, two identical values may have different fingerprints in different evaluations or when _fingerprint is called at different points in the evaluation.

fp = _fingerprint("foobar");

// fp == "f0b413200100000002000000d0804844"

Fingerprints are used internally by the evaluator and the cache server to facilitate incremental builds.  Most of the time, there's no need to use them.  However, they can be useful as version stamps for Vesta evaluations.  Two identical models in identical directories will have the same fingerprint, even though _model_name may return different values for each of them.

When source files are added to the repository, they often have their fingerprint assigned based on their content (essentially a check-sum).  (See the vadvance man page.)  Derived files can also be assigned fingerprints based on their content.  (See the documentation of the _run_tool function, specifically its fp_content parameter.)


Kenneth C. Schalk <ken@xorian.net> / Primitive Functions / Vesta SDL Programmer's Reference