0

I am trying to use some lambdas in functional updates. Simple example would be

parse "update cfoo:foo'[c] from t"

!
`t

falseb
,`cfoo!,((`func;`foo);`c)

What is the `func in that parse tree? With what do I need to replace it in below?

![`t;();0b;(enlist `cfoo)!enlist ((`func;`foo);`c)]

1 Answer 1

5

Parsing the same thing as you gives me a different thing than what you have:

q)parse "update cfoo:foo'[c] from t"
!
`t
()
0b
(,`cfoo)!,((';`foo);`c)

Which would look like:

![`t;();0b;(enlist`cfoo)!enlist((';`foo);`c)]

The above comes straight from the `q prompt. You either parsed a different thing or your GUI/IDE changed something in the final output.

The func is nothing else but the ' you are applying to [c]. Here's an example where I have changed the ' with something else:

q)parse "update cfoo:foo/:[c] from t"
!
`t
()
0b
(,`cfoo)!,((/:;`foo);`c)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.