close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#330 closed defect (fixed)

Sort function

Reported by: Alfredo Torre Owned by: danirus
Priority: normal Milestone:
Component: SetAlgebra Version: head
Severity: normal Keywords:
Cc: imendez

Description

Set Set01 = SetOfAnything(Real 1, Text "hola");
Set Set01_Ord = Sort(Set01, Real(Anything any01, Anything any02)
{

Text gram01 = Grammar(any01);
Text gram02 = Grammar(any02);

WriteLn("gram01: "+ gram01);
WriteLn("gram02: "+ gram02);

Compare(gram01, gram02)

});

Change History (4)

comment:1 Changed 19 years ago by Alfredo Torre

Sort function does not allow Sets with elements from diferents Grammar as you
can see in the example:

Set Set01 = SetOfAnything(Real 1, Text "hola");
Set Set01_Ord = Sort(Set01, Real(Anything any01, Anything any02)
{

Text gram01 = Grammar(any01);
Text gram02 = Grammar(any02);

WriteLn("gram01: "+ gram01);
WriteLn("gram02: "+ gram02);

Compare(gram01, gram02)

});

I think that should work in TOL as EvalSet does:

Set Set01 = SetOfAnything(Real 1, Text "hola");
Set Set01_ES = EvalSet(Set01, Set(Anything any)
{ SetOfAnything(Grammar(any), any)});

comment:2 Changed 19 years ago by danirus

Status: newassigned

comment:3 Changed 19 years ago by danirus

Resolution: fixed
Status: assignedclosed

This tiny enhancement has been implemented.
Sort must accept a 2nd argument with arguments of type "Anything".
In that case, that 2nd argument will care about comparison stuff.

Alfredo, your code works now without problems.
Cheers
Daniel

comment:4 Changed 18 years ago by Víctor de Buen Remiro

bug_file_loc: http://cvs.tol-project.org/viewcvs.cgi/tol_tests/tol/Bugzilla/bug_000330
Note: See TracTickets for help on using tickets.