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 8930187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:49:49+00:00 2026-06-15T08:49:49+00:00

Could someone kindly explain the control structure in J (specifically For and While loops)?

  • 0

Could someone kindly explain the control structure in J (specifically For and While loops)?
Let’s say I have a=:1 and b=:10, and I want to add ‘1’ to ‘a’ using For/While loops till a < b.

So, usually it would be something like (in other languages)

for i= 1 to b   
a=a+1    
next i

or

while a<=b    
a=a+1    
end

Help please. I know it’s simple, but I can’t figure out how to do this in loops.

Also, I read up on something called “explicits”. For example:

foo=: 3 : 0
if. 1 do. wdinfo 'success' end.
)

What would the 3 and 0 denote?

  • 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-15T08:49:50+00:00Added an answer on June 15, 2026 at 8:49 am

    Control structures must be used within an explicit definition.
    The explicit definition link will explain what the “3” and “0” signify, but note that the following are equivalent.

    myfunction=: 3 : 0
      NB. define function/verb here
    ) 
    
    myfunction=: verb define
      NB. define function/verb here
    ) 
    

    Here is an example of defining an explicit function/verb containing a for loop:

    for_eg=: verb define
     a=. 3
     b=. 8
     for. i.b do.
       a=. a + 1
     end. 
     a
    )
    

    Here is an example of using that verb:

    for_eg ''
    11
    

    The Jwiki contains a wiki page describing how to define a verb. Note the references at the bottom for more info.

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

Sidebar

Related Questions

Could someone kindly help me get this parsed. I have the following XML. I
I have the following input values and I was hoping someone could kindly tell
Could someone help me to add A-atype B-btype C-ctype ONLY as a legend to
Could someone please explain why this is happening? var y = new int[]{1,2}; Console.WriteLine(y
Could someone please explain this weird phenomenon: http://jsfiddle.net/sPA2V/ For some reason, the box footer
Would someone kindly assist me with the following? I have two DataGridView objects that
I don't know if anyone could kindly explain this code for me? unsigned int
Could someone kindly point me why this snippet is not compiled: my $crond =
Could someone explain the following? >>> a = {1} >>> b = {2} >>>
could someone explain me what XOR , (^) does in the fallowing code exaclly

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.