t_hashconcat (v,sep="; ") = t_word(v,,sep) t_hashpair (H,x,innersep=":") = {x=t_strip(x); Strexpand(t_split_2(x,innersep),"=",t_hashval(H,t_split_1(x,innersep)))} t_hashpart (H,a,sep="; ", innersep=":") = {my (u); u=t_split(a); t_hashconcat([t_hashpair(H,x,innersep) | x<-u],sep)} t_hashpieces (H) = t_split(H,";") \\ Vars in New must belong to Old. \\ The order of the vars does not change. t_hashredef (Old,New,sep="; ") = {my (vars,varsnew,pieces,j); vars=t_hashvars(Old); varsnew=t_hashvars(New); pieces=[Strexpand(x,"=", if (j=t_pos(x,varsnew), t_hashval(New,x), t_hashval(Old,x))) | x<-vars]; t_hashconcat(pieces,sep)} \\ For common vars the value in B is chosen. \\ The order of the vars changes. t_hashunion (A,B,sep="; ") = {my (varsA,varsB,vars,pieces,j); varsA=Set(t_hashvars(A)); varsB=Set(t_hashvars(B)); vars=setunion(varsA,varsB); pieces=[Strexpand(x,"=", if (j=t_pos(x,varsB), t_hashval(B,x), t_hashval(A,x))) | x<-vars]; t_hashconcat(pieces,sep)} t_hashval (H,x) = {my (vars,i); vars=t_hashvars(H); x=t_strip(x); i=t_pos(x,vars); if (!i,0, t_hashvals(H)[i])} t_hashvals (H) = {my (pairs,u); pairs=[t_splitdef(a) | a<-t_hashpieces(H)]; [t_evaln(t_strip(p[2])) | p<-pairs]} t_hashvars (H) = {my (pairs); pairs=[t_splitdef(a) | a<-t_hashpieces(H)]; [t_strip(p[1]) | p<-pairs]}