Guides/General FAQ/Add FAQ

From J Wiki
Jump to navigation Jump to search

How to add a FAQ?

What to add?

Compile a lists of possible FAQs on this page. If you're not sure your question is a "FAQ", or whether it's appropriate for this list, or don't yet have a well presented response the the FAQ, just leave it on this page. You can do some research & come back to it later, or solicit help from other users (possibly on the Forums).

If you're sure you have a FAQ, it deserves an answer, and you have one, please add both the FAQ and the answer to the appropriate FAQ page (listed below).

Please try to phrase the FAQs and answers such that they're easy to search for when the question arises. For example, how do we phrase the question:

      • Why doesn't +:^:3 2 work?

when nothing in the J code is a given? When a newbie encounters this class of problem for the first time, what words would he search for?

Also (when possible), do some research. If the FAQ has been answered or provided for in the wiki, the forums, the standard library, or the user library, please provide a link, with attribution and a description.

Newbie FAQs

  • Why doesn't +:^:3 2 work?
  • $&> ,<'hello' is 5 but $ > ,<'hello is 1 5. Why?
  • Why doesn't (;: 'this is j')-:'this';'is';'j' hold?

General FAQs

  • Why does ''-:i.0 hold?

Because no items differ.

  • What's up with 'boxed' -: datatype >0$a:?

One way to look at it is: it's impossible to know the datatype of the contents boxes of that aren't there. Since boxed arrays can front any data type (and even multiple data types, i.e. when used to junction heterogeneous data), this answer is appropriate. What should be the result of datatype > 0 $ 'text';1bsome 1bnumbers;s:' symbols'?

  • Arithmetic identity questions. Why do the following sentences hold?

1. Why are 0=0%0 and _=1%0? (i.e. explain division by zero): Answered in the paper by E. E. McDonnell, 1. Why is 1=0^0 ? Discussed on the college math 0^0 thread on the Forums, and may be required if 0=0%0.

1. How can I configure or change those results? You cannot change the result of a J primitive. You may, however, write a cover function

    div =: 4 : 0

        z  =.  x % y
        q  =.  _. _ __ {~ *x
        y0 =. ($z) $ y = 0
        z  =.  y0 } z ,: q

)
   10 100 1 _1 0 div 2 _10 0 0 0
5 _10 _ __ _.
  • Explain execution of a verb on an empty frame e.&0@:$ with a cell of fills.

See Also