statebox/cql

non-lambda attributes

wisnesky opened this issue · 8 comments

non-lambda attributes

Should allow att1 -> att2 in addition to att1 -> lambda x. att2(x)

This is in MapExpRaw. The 'x' in the lambda should be given a name that can't shadow any other name; in Aql java, we punted and just made up a name that is unlikely to appear elsewhere.

This is low priority but some Aql examples do rely on it.

It's not completely clear to me what needs to be done here, especially the part about the x.

Are you referring to https://github.com/CategoricalData/fql/blob/520e24963d399ef6e04e35d60f11a1e9f91e3c85/src/main/java/catdata/aql/exp/CombinatorParser.java#L1168?

Is it the problem the fact that you need a name of the attribute to return something of the type (String, (String, RawTerm))? If so, would it be ok to create a new datatype

data MappingAttributeTerm
    = MappingAttributeTermLambda String String RawTerm
    | MappingAttributeTermPath _

so that we could treat the two cases indipendently without reverting to strange tricks?

@wisnesky I pushed on the branch https://github.com/statebox/aql/tree/54/non-lambda-attributes the parser for point free attributes.

I am a bit stuck though with the implementation of evalMappingRaw'. Would it be possible for you to help me with it? Maybe even with some pair programming

I went ahead and added this to the latest commit, but I re-did the parser stuff. I'm sorry Marco but I just can't seem to get my head around how your parsers map onto AQL syntax.

don't worry. You clearly have a clearer idea around this stuff