[Ur] row.T

Gergely Buday gbuday at gmail.com
Thu Nov 24 06:07:56 EST 2011


>>  rows<- queryX (SELECT * FROM t)
>>             (fn row =>  <xml><tr>
>>               <td>{[row.T.A]}</td>  <td>{[row.T.B]}</td>
>> <td>{[row.T.C]}</td>  <td>{[row.T.D]}</td>
>>               <td><form><submit action={delete row.T.A}
>> value="Delete"/></form></td>
>>             </tr></xml>);
>>
>> Where does this T in row.T.A come from? Does row have any other field?
>>
>> - Gergely
>
> It comes from the name of the table (in this case t), but then capitalized.

val queryX : tables ::: {{Type}} -> exps ::: {Type} -> ctx ::: {Unit}
-> inp ::: {Type}
   192              -> [tables ~ exps] =>
   193              sql_query [] [] tables exps
   194              -> ($(exps ++ map (fn fields :: {Type} => $fields) tables)
   195                  -> xml ctx inp [])
   196              -> transaction (xml ctx inp [])

Do I understand correctly that the compiler extracts tables, exps, ctx
and inp from the sql query?

- Gergely



More information about the Ur mailing list