[Ur] project to a fieldname list

Gergely Buday gbuday at gmail.com
Sat Oct 22 01:25:16 EDT 2011


>> my idea is to write a function that projectds records to a given set
>> of names. Is it doable in Ur/Web?
>
> I'm not sure exactly what you're asking for.  Does the [---] operator do the
> trick?  Its first argument is a value of record type, and its second
> argument is a constructor of kind [{Type}], specifying which fields to
> remove from the record.

It is clear what is record.1 . I would like to have

  record.[1,2,3,4]

independently what other fields does r have.

>> fun projection [ r ::: {Type} ] (names :: {Unit}) (record : $r) : (map
>> (fn nm =>  record.nm) names) = ()

Clearly record.nm is a failed attempt, but then how to express it? r.nm?

- Gergely



More information about the Ur mailing list