Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9130603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:59:31+00:00 2026-06-17T07:59:31+00:00

I have a sequence of length $n initialized to zeroes: let $seq := (for

  • 0

I have a sequence of length $n initialized to zeroes:

let $seq := (for $i in (1 to $n) return 0)

I can access a position easily…

return $seq[5]

…but how do I update it? (the following doesn’t work)

let $seq[5] := $seq[5] + 1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:59:31+00:00Added an answer on June 17, 2026 at 7:59 am

    If you’re using an XQuery implementation which supports XQuery 3 maps (eg. Saxon, BaseX), you could use these:

    declare namespace map="http://www.w3.org/2005/xpath-functions/map";
    
    (: Fill map with square numbers :)
    let $map := map:new(
      for $i in (1 to 10)
      return map:entry($i, $i*$i)
    )
    (: Overwrite a single value :)
    let $map := map:new(($map, map:entry(2, 5)))
    (: Fetch this value :)
    return map:get($map, 2)
    

    But generally it is possible to solve a problem without maps and in most cases this code will probably run faster as it will get better optimized.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let us presume we have k sequences of fixed length p . Each sequence
I have a sequence which varies in length e.g. something like: items <- 1:4
I have a sequence with an allowed minimum length of zero in my xsd.
If I have a sequence as follows (let's say it's an IEnumerable<T> ): [A,
I have no idea how to access FilenameType_sequence class ns1__FilenameType { public: // SEQUENCE
I have the following code and I use ReadUnsignedByte() function but hangs and doesn't
Let's say I have an array a of length n and a second array
I know the exact sequence and length of my TrueCrypt partition's password, but I
I have a Sequence that I want to get the length of: val x
Let's say I have an extremely large sequence of characters of A-D, 4 Billion

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.