Explorer

core.compile-env-lookup

description
Local index bound to the variable id in the compile environment (searched from the front), or -1
type
Fn(env: List<Record{variable_id: Number, local: Number}>, variable_id: Number, index: Number) -> Number
expression
fn(env$0, variable_id$1, index$2) =>
  match @core.list-get(list: $0, index: $2) {
    #none(_) =>
      -1,
    #some(item$1004) =>
      let entry$3 = $1004;
      match @core.equal(left: $3.variable_id, right: $1) {
        true =>
          $3.local,
        false =>
          @core.compile-env-lookup(env: $0, variable_id: $1, index: @core.plus(left: $2, right: 1))
      }
  }
visibility
public
core.compile-env-lookup (project definy, branch main, snapshot CfIAXM725tR74SWd4aoTUz4-JJQfqnllblZbQ2Sv204)
id: yjVx89PpCeHeeIM9N3ui1QE_9LIqMbwwDbPEi718vSs
content hash: qTYFZZaMHorFhIKLXQX7g-C0J5y_FL9F5Uswr5DHLzs