You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The extra work of finding the size of the array and iterating through its members is actually not necessary when we use the alternative lookup syntax. Can you rewrite this example with the lookup syntax?
I wasn't exactly sure what you meant by "alternative lookup syntax." Did you mean the ? lookup operator? Are you asking the student to write out a more verbose path rather than use map:find()?
Joe
The text was updated successfully, but these errors were encountered:
Yes, I had in mind simplifying the expression like so:
let $lookup-word := local:lookup-word(?, $id, $key)
let $definitions := map:find($lookup-word($word), "definitions")
for $definition at $num in $definitions?*
return $num || ". " || $definition
In other words, I wanted to show students that the ?* operator is really a shorthand for iterating through the size of the array and calling a function to return every item in the array. Do you have a suggestion for improving the wording?
Hi Cliff,
In 03, around line 470, there's this paragraph:
I wasn't exactly sure what you meant by "alternative lookup syntax." Did you mean the
?
lookup operator? Are you asking the student to write out a more verbose path rather than usemap:find()
?Joe
The text was updated successfully, but these errors were encountered: