Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.9K Views
|
3 Replies
|
4 Total Likes
View groups...
Share
Share this post:

KeyValueMap with optional argument

Posted 2 years ago
POSTED BY: Jak SD
3 Replies
Posted 2 years ago

Thank you very much, Eric and Henrik - just what I hoped for. Much appreciated. Have a great day/evening!

POSTED BY: Jak SD
Posted 2 years ago

You can create an anonymous function:

KeyValueMap[f[##, "THIRD VALUE"] &, list]
POSTED BY: Eric Rimbey

Here is one simple way:

f[third_][key_, value_] := Print[key, " name is ", value, " (", third, ")"]

Then, e.g.:

enter image description here

POSTED BY: Henrik Schachner
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard