Dyalog / Dyalog/ride

Pasting APL code into a function causes a problem on the PI

Open
#1,007 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
233
Forks
35
Avg merge
4m
Merged PRs (30d)
2

Description

### Describe the issue you are having

I pasted this code:

```
{r}←{force}Init_SHA256 dummy;⎕USING;filename;path;OS
⍝ Make the necessary preparations for hashing a password.\\
⍝ Once initiallized, the function does not run its code again, except when a 1 is passed as `⍺`.
force←{0<⎕NC ⍵:⍎⍵ ⋄ 0}'force'
'⍺ must be a Boolean'Assert(⊂force)∊0 1
:If 9≠⎕NC'SHA256'
:OrIf force
OS←APLTreeUtils2.GetOperatingSystem ⍬
:If 'Win'≡OS
⎕USING←',System.Security.Cryptography.Algorithms',('W'=⊃⊃'.'⎕WG'APLVersion')/'.dll'
SHA256←⎕NEW System.Security.Cryptography.SHA256Managed
:Else
'SHA256'⎕NS''
:If 0=≢path←PathToCongaDLLs
path←(2 ⎕NQ #'GetEnvironment' 'Dyalog'),'/lib/'
:EndIf
filename←⊃FilesAndDirs.ListFiles path,'libconga??ssl',((1+Is64Bit)⊃'32' '64'),(1+'Mac'≡OS)⊃'so' 'dylib'
'Conga DLL not found'Assert 0<≢filename
'Init'SHA256.⎕NA filename,'|nettle_sha256_init >I1[112]'
'Update'SHA256.⎕NA filename,'|nettle_sha256_update =I1[112] U8 U1[32]'
SHA256.⎕FX'digest←ComputeHash data;ctx' 'data←⎕UCS⊃data' 'ctx←Init 112' 'ctx←Update ctx(⍴data)data' '(ctx digest)←Digest ctx 32 32'
:EndIf
:EndIf
```

First I thought that the `:Else` branch is not on display in the function editor: instead three very small red dots are shown. I have added a screenshot.

But it is more complex than that: the last line **_before_** the `:Else` branch is **_not_** shown, but the last line of the `:Else` branch **_is_**!

I am using Ride 4.4 in connection with a 32-bit Dyalog APL on a 64-bit PI 400.

```
IDE:
Version: 4.4.3687
Platform: Linux aarch64
Date: 2022-02-23 13:44:34 +0100
Git commit: a3d8123cfb690ead493e261ccced59407db04c64
Preferences:{
"autoPW":"1",
"autocompletionDelay":"150",
"kbdLocale":"en_US",
"zoom":"3"
}

Interpreter:
Version: 18.2.47420
Platform: Linux
Edition: Unicode/32
Date: Jul 4 2023 at 00:19:00

```
This is my `<02102>`
![Else](https://github.com/Dyalog/ride/assets/16479389/810ddd27-0ef8-468b-8736-f4b31a50f64f)

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue by pasting the supplied APL function into Ride 4.4.3687 on the reported Raspberry Pi and interpreter versions. Inspect the function editor around the :Else branch and verify that all pasted lines, including the line before :Else, render correctly; no source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.