Skip to content

Commit

Permalink
Merge pull request #32 from Dyalog/v0.4.3-pr
Browse files Browse the repository at this point in the history
v0.4.3 release PR.
  • Loading branch information
rodrigogiraoserrao committed Feb 13, 2022
2 parents 06546a7 + ee610e8 commit 695e73f
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 97 deletions.
26 changes: 13 additions & 13 deletions Execute-and-Format-Control.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@
"id": "sacred-netscape",
"metadata": {},
"source": [
"<!--begin beware style=warning-->\n",
"<!-- begin beware style=warning -->\n",
"***Beware***:\n",
"\n",
" > Note that if the argument does not return a result, it can still be executed, but _execute_ will not return a result, and any attempt to assign it to a variable or to use it in any other way will cause a `VALUE ERROR`.\n",
"<!--end-->\n",
"<!-- end -->\n",
"\n",
"Take a modification of our `Plus` function that returns no result:"
]
Expand Down Expand Up @@ -1325,11 +1325,11 @@
"id": "sound-newton",
"metadata": {},
"source": [
"<!--begin remark-->\n",
"<!-- begin remark -->\n",
"***Remark***:\n",
"\n",
" > You can see that the numbers to be formatted are **rounded** rather than truncated when the specified format does not allow the full precision of the numbers to be shown.\n",
"<!--end-->"
"<!-- end -->"
]
},
{
Expand Down Expand Up @@ -1473,7 +1473,7 @@
"id": "color-shannon",
"metadata": {},
"source": [
"<!--begin remark-->\n",
"<!-- begin remark -->\n",
"***Remark***:\n",
"\n",
" > To calculate the width required to represent a number you must account for the minus sign, the integer digits, the decimal point, and as many decimal digits as specified in the _descriptor_.\n",
Expand Down Expand Up @@ -2151,12 +2151,12 @@
" - `'A4'`: the first column of `chemistry`, displayed in a column that is 4 characters wide, produces a separation of 3 blanks; and\n",
" - `'9A1'`: the subsequent columns of `chemistry` are displayed in (up to) 9 columns, each of which is 1 character wide.\n",
"\n",
"<!--begin remarks-->\n",
"<!-- begin remark -->\n",
"***Remarks***:\n",
"\n",
" > - Specifications (`'I'`, `'F'`, `'A'`, ...) must be uppercase letters (lowercase specifications cause errors); and\n",
" > - We specified `'9A1'`, though we had only 4 remaining columns to format, with no problems; `⎕FMT` ignores excess repetition factors.\n",
"<!--end-->\n",
"<!-- end -->\n",
"\n",
"But what would happen if the first descriptor was larger than necessary?"
]
Expand Down Expand Up @@ -3157,11 +3157,11 @@
"id": "completed-holmes",
"metadata": {},
"source": [
"<!--begin tip-->\n",
"<!-- begin tip -->\n",
"***Tip***:\n",
"\n",
" > In the use-case above, the number of decimal places you use in the text descriptor of the specification `'G'` is the number `n` you should use with the qualifier `'Kn'`.\n",
"<!--end-->\n",
"<!-- end -->\n",
"\n",
"Now we use the qualifier `'Z'` to pad values with zeroes on the left.\n",
"Notice, also, how a repetition factor may be applied to a list of specifications enclosed by parentheses:"
Expand Down Expand Up @@ -5277,11 +5277,11 @@
"id": "russian-cream",
"metadata": {},
"source": [
"<!--begin remark-->\n",
"<!-- begin remark -->\n",
"***Remark***:\n",
"\n",
" > We can see that `]display` is similar to `dfns.display` and that `]disp` is similar to `dfns.disp`, but there is one fundamental difference: only the `dfns` functions can be called from within other functions; the user commands can only be used from within the interpreter session.\n",
"<!--end-->\n",
"<!-- end -->\n",
"\n",
"The previous remark justifies the existence of these pairs of functions/user commands that are so similar: the user commands are extremely handy for use in the session, but the functions are necessary if we want to use that functionality from within other functions."
]
Expand Down Expand Up @@ -6232,12 +6232,12 @@
"From the help description we can see that the `]rows` command exists to handle output that is too tall and/or too wide to fit the session window.\n",
"What does \"too tall\" or \"too wide\" mean?\n",
"\n",
"<!--begin remark-->\n",
"<!-- begin remark -->\n",
"***Remark***:\n",
"\n",
" > In the Jupyter interface, the screen width that `]rows` uses internally might not match the actual width you have available to display results.\n",
" > It is advisable that you use RIDE or the Windows interpreter to test the user command `]rows`.\n",
"<!--end-->\n",
"<!-- end -->\n",
"\n",
"Let us start by talking about wide output.\n",
"When using the interpreter, the output is \"too wide\" if it would extend beyond the session window width.\n",
Expand Down
38 changes: 19 additions & 19 deletions First-Aid-Kit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1447,15 +1447,15 @@
"\n",
"You should also be aware that because APL preserves the full context in which a function stopped or crashed, all the local variables are retained too; this may require a lot of memory space!\n",
"\n",
"<!--begin tip-->\n",
"***Recommendation***:\n",
"<!-- begin tip -->\n",
"***Tip***:\n",
"\n",
" > When a function crashes, always try to clear the stack if you can:\n",
" > - try to correct the problem and resume function execution; or\n",
" > - if that is impossible, abort it and reset the execution context by executing `)reset`.\n",
" >\n",
" > If you can't fix it *right now*, Dyalog will allow you to `)save` the workspace and come back to it later.\n",
"<!--end-->"
"<!-- end -->"
]
},
{
Expand Down Expand Up @@ -1611,11 +1611,11 @@
"id": "nonprofit-encyclopedia",
"metadata": {},
"source": [
"<!--begin tip-->\n",
"***Suggestion***:\n",
"<!-- begin tip -->\n",
"***Tip***:\n",
"\n",
" > If an operation like `X+Y` causes a `LENGTH ERROR`, look at the shapes of both arguments `X` and `Y`, and see if they are compatible with one another.\n",
"<!--end-->\n",
"<!-- end -->\n",
"\n",
"Also remember that:\n",
" - a matrix with only one row looks like (but is not) a vector and a matrix/vector with only one element looks like (but is not) a scalar (see [this subsection](./Data-and-Variables.ipynb#Beware)); and\n",
Expand Down Expand Up @@ -1970,11 +1970,11 @@
"source": [
"Notice the misplaced comma, which leads APL to try and calculate `MatA[1]`, which fails because `MatA` is a matrix and not a vector.\n",
"\n",
"<!--begin tip-->\n",
"***Suggestion***:\n",
"<!-- begin tip -->\n",
"***Tip***:\n",
"\n",
" > If a statement causes a `RANK ERROR`, look at the shapes of all the arrays involved in the expression.\n",
"<!--end-->"
"<!-- end -->"
]
},
{
Expand Down Expand Up @@ -2020,11 +2020,11 @@
"source": [
"This doesn't work because `forecast` has 6 columns but only 4 rows: the second index is good but the first one is not.\n",
"\n",
"<!--begin tip-->\n",
"***Suggestion***:\n",
"<!-- begin tip -->\n",
"***Tip***:\n",
"\n",
" > If the error occurs in an indexing operation like `var[indexA;indexB;...]`, look at the shape of `var` and check if `indexA`, `indexB`, etc., contain values which are compatible with the size of `var`.\n",
"<!--end-->"
"<!-- end -->"
]
},
{
Expand Down Expand Up @@ -2280,12 +2280,12 @@
"More generally, all these statements are in themselves perfectly correct when applied to appropriate data.\n",
"However, they may fail when applied to other, inappropriate data.\n",
"\n",
"<!--begin tip-->\n",
"***Suggestion***:\n",
"<!-- begin tip -->\n",
"***Tip***:\n",
"\n",
" > Do not worry too much about the syntax of your statement: it is probably good.\n",
" > You should instead try to determine which values are appropriate to the operation, and check whether the actual values are within the operation's domain.\n",
"<!--end-->"
"<!-- end -->"
]
},
{
Expand Down Expand Up @@ -2742,11 +2742,11 @@
"It is up to you to decide which configuration is most convenient for you.\n",
"In any case, this can be changed dynamically, without restarting APL.\n",
"\n",
"<!--begin note-->\n",
"<!-- begin note -->\n",
"***Note***:\n",
"\n",
" > Notice that some of these settings might also affect how *edit* windows are displayed, so be sure to have that in mind when picking your preferred configuration.\n",
"<!--end-->"
"<!-- end -->"
]
},
{
Expand Down Expand Up @@ -3091,11 +3091,11 @@
"Whenever a line marked by a trace-control is executed, the last value calculated on that line will be displayed in the session, without interrupting execution.\n",
"Let us explore this technique.\n",
"\n",
"<!--begin remark-->\n",
"<!-- begin remark -->\n",
"***Remark***:\n",
"\n",
" > Bear in mind that this technique only works with tradfns, which is one of the reasons we said tradfns can be easier to debug in [the previous chapter](./User-Defined-Functions.ipynb#Use-cases).\n",
"<!--end-->\n",
"<!-- end -->\n",
"\n",
"First, in `Palindrome`, let us replace `ReverBug` by another looping function, `ReverLoop`, that is more appropriate for this test:"
]
Expand Down
4 changes: 2 additions & 2 deletions Some-Primitive-Functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7406,8 +7406,8 @@
" - extract some useful items from a variable; or\n",
" - remove some unwanted items from a variable, which is the same thing.\n",
" \n",
"<!-- begin advice style=hint -->\n",
"***Advice***:\n",
"<!-- begin tip -->\n",
"***Tip***:\n",
"\n",
" > Every time you obtain a Boolean vector, you should immediately think of two major things you can do with it: *count* or *select*.\n",
"<!-- end -->\n",
Expand Down
Loading

0 comments on commit 695e73f

Please sign in to comment.