public ElaRecord AddFields(ElaRecord fields, ElaRecord rec) { var fieldList = new List<ElaRecordField>(); fieldList.AddRange(rec); fieldList.AddRange(fields); return new ElaRecord(fieldList.ToArray()); }
public ElaRecord AddField(string field, ElaValue value, ElaRecord rec) { var fieldList = new List<ElaRecordField>(); fieldList.AddRange(rec); fieldList.Add(new ElaRecordField(field, value)); return new ElaRecord(fieldList.ToArray()); }
public ElaRecord AddFields(ElaRecord fields, ElaRecord rec) { var fieldList = new List <ElaRecordField>(); fieldList.AddRange(rec); fieldList.AddRange(fields); return(new ElaRecord(fieldList.ToArray())); }
public ElaRecord AddField(string field, ElaValue value, ElaRecord rec) { var fieldList = new List <ElaRecordField>(); fieldList.AddRange(rec); fieldList.Add(new ElaRecordField(field, value)); return(new ElaRecord(fieldList.ToArray())); }
public ElaMutableMap CreateMap(ElaRecord rec) { var map = new ElaMutableMap(); foreach (var k in rec.GetKeys()) map.Map.Add(new ElaValue(k), rec[k]); return map; }
public ElaMap CreateMap(ElaRecord rec) { var map = ElaMap.Empty; foreach (var k in rec.GetKeys()) map = new ElaMap(map.Tree.Add(new ElaValue(k), rec[k])); return map; }
public ElaRecord RemoveField(string field, ElaRecord rec) { var fieldList = new List<ElaRecordField>(); foreach (var f in rec) if (f.Field != field) fieldList.Add(f); return new ElaRecord(fieldList.ToArray()); }
public ElaRecord RemoveFields(IEnumerable<String> fields, ElaRecord rec) { var fieldList = new List<ElaRecordField>(); var fieldArr = new List<String>(fields); foreach (var f in rec) if (fieldArr.IndexOf(f.Field) == -1) fieldList.Add(f); return new ElaRecord(fieldList.ToArray()); }
public ElaValue ShowRecordKey(int field, ElaRecord rec) { var fl = rec.keys[field]; if (fl.IndexOf(' ') != -1 || Format.IsSymbolic(fl)) { return(new ElaValue("\"" + fl + "\"")); } return(new ElaValue(fl)); }
public ElaRecord ChangeField(string field, ElaValue value, ElaRecord rec) { var fieldList = new List<ElaRecordField>(); foreach (var f in rec) if (f.Field == field) fieldList.Add(new ElaRecordField(f.Field, value)); else fieldList.Add(f); return new ElaRecord(fieldList.ToArray()); }
internal override ElaValue Concatenate(ElaValue left, ElaValue right, ExecutionContext ctx) { left = left.Ref.Force(left, ctx); right = right.Ref.Force(right, ctx); if (right.TypeId != ElaMachine.REC) { NoOverloadBinary(TCF.RECORD, right, "concatenate", ctx); return(Default()); } return(new ElaValue(ElaRecord.Concat((ElaRecord)left.Ref, (ElaRecord)right.Ref))); }
public ElaRecord RemoveField(string field, ElaRecord rec) { var fieldList = new List <ElaRecordField>(); foreach (var f in rec) { if (f.Field != field) { fieldList.Add(f); } } return(new ElaRecord(fieldList.ToArray())); }
public ElaRecord RemoveFields(IEnumerable <String> fields, ElaRecord rec) { var fieldList = new List <ElaRecordField>(); var fieldArr = new List <String>(fields); foreach (var f in rec) { if (fieldArr.IndexOf(f.Field) == -1) { fieldList.Add(f); } } return(new ElaRecord(fieldList.ToArray())); }
public ElaRecord ChangeField(string field, ElaValue value, ElaRecord rec) { var fieldList = new List <ElaRecordField>(); foreach (var f in rec) { if (f.Field == field) { fieldList.Add(new ElaRecordField(f.Field, value)); } else { fieldList.Add(f); } } return(new ElaRecord(fieldList.ToArray())); }
public ElaList GetFields(ElaRecord rec) { return(ElaList.FromEnumerable(rec.GetKeys())); }
public ElaList GetFields(ElaRecord rec) { return ElaList.FromEnumerable(rec.GetKeys()); }