I'm testing an expression with two inequalities for the condition of a list comprehension. Is there a way to have assignments here and not duplicate that expression?
The following code doesn't work, but I wish it would:
diagnose(Expertise,PatientSymptoms) ->
{[CertainDisease||
{CertainDisease,KnownSymptoms}<-Expertise,
C=length(PatientSymptoms)-length(PatientSymptoms--KnownSymptoms),
C>=2,
C<=5
]}.