Explorer

core.eval-hash-index-bucket

description
The items (in order) that go to the bucket in list_hash_index in the evaluator
type
Fn(
  items: List<@core.value>,
  field: String,
  size: Number,
  bucket: Number,
  index: Number,
  accum: List<@core.value>
) -> List<@core.value>
expression
fn(items$0, field$1, size$2, bucket$3, index$4, accum$5) =>
  match @core.list-get(list: $0, index: $4) {
    #none(_) =>
      $5,
    #some(item$6) =>
      let next$7 = @core.plus(left: $4, right: 1);
      match $6 {
        #record(fields$8) =>
          match @core.equal(
              left: @core.bit-and(
                left: @core.eval-value-hash(value: @core.record-field-lookup(items: $8, key: $1, index: 0)),
                right: @core.minus(left: $2, right: 1)
              ),
              right: $3
            ) {
            true =>
              @core.eval-hash-index-bucket(
                items: $0,
                field: $1,
                size: $2,
                bucket: $3,
                index: $7,
                accum: @core.list-append(list: $5, item: $6)
              ),
            false =>
              @core.eval-hash-index-bucket(items: $0, field: $1, size: $2, bucket: $3, index: $7, accum: $5)
          },
        _ =>
          match @core.equal(left: $3, right: 0) {
            true =>
              @core.eval-hash-index-bucket(
                items: $0,
                field: $1,
                size: $2,
                bucket: $3,
                index: $7,
                accum: @core.list-append(list: $5, item: $6)
              ),
            false =>
              @core.eval-hash-index-bucket(items: $0, field: $1, size: $2, bucket: $3, index: $7, accum: $5)
          }
      }
  }
visibility
public
core.eval-hash-index-bucket (project definy, branch auto-release, snapshot oiQgPqhJm-TbM4kexXeRHBaJB_tS7gwBSewII64P-44)
id: M4GqhnRR6tc8mHlScuAQotJaOakBSQcN-Tx1IcpO8kg
content hash: Uss75Fegl-isthWTD-UPhRtyr5DCMrCmovYq3iSVPtQ