Skip to content

Commit

Permalink
avoid prototype issues
Browse files Browse the repository at this point in the history
  • Loading branch information
abrudz committed Jun 7, 2020
1 parent d22a382 commit f6918b1
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 12 deletions.
4 changes: 2 additions & 2 deletions IotaUnderbar.aplf
@@ -1,5 +1,5 @@
IotaUnderbar←{ ⍝ ⍸ ⍝ just ⎕IO
⎕IO←0
IotaUnderbar←{ ⍝ ⍸ ⎕IO←0 for monadic but ⎕IO←1 for dyadic
⎕IO←×⎕NC'⍺'
⍺←⊢
⍺⍸⍵
}
2 changes: 1 addition & 1 deletion LeftShoe.aplf
@@ -1,4 +1,4 @@
LeftShoe←{ ⍝ ⊂ just ⎕IO
LeftShoe←{ ⍝ ⊂ just ⎕IO
0=⎕NC'⍺':⊂⍵
⍺⊂[⎕IO]⍵
}
9 changes: 5 additions & 4 deletions README.md
Expand Up @@ -40,18 +40,19 @@ Now you have three options:
|[DownTack](DownTack.aplf)|``|transposed and extend scalar|
|[Epsilon](Epsilon.aplf)|``|on major cells|
|[Iota](Iota.aplf)|``|noticing 1-element vector|
|[IotaUnderbar](IotaUnderbar.aplf)|``|⍝ just `⎕IO`|
|[LeftShoe](LeftShoe.aplf)|``|just `⎕IO`|
|[IotaUnderbar](IotaUnderbar.aplf)|``|`⎕IO←0` for monadic but `⎕IO←1` for dyadic|
|[LeftShoe](LeftShoe.aplf)|``|just `⎕IO|`
|[LeftShoeUnderbar](LeftShoeUnderbar.aplf)|``|on major cells|
|[Plus](Plus.aplf)|`+`|purely numeric|
|[QuadDivide](QuadDivide.aplf)|``|high rank|
|[Query](Query.aplf)|`?`|high rank|
|[RightShoe](RightShoe.aplf)|``|just `⎕IO`|
|[RightShoe](RightShoe.aplf)|``|just `⎕IO|`
|[SlashBar](SlashBar.aplf)|``|only replicate first|
|[Squad](Squad.aplf)|``|but sane|
|[Tilde](Tilde.aplf)|`~`|on major cells|
|[UpShoe](UpShoe.aplf)|``|on major cells|
|[UpTack](UpTack.aplf)|``|transposed|
|[_BackSlash](_BackSlash.aplo)|`\`|scan first and outer product|
|[_Diaeresis](_Diaeresis.aplo)|`¨`|ignoring empty arrays|
|[_CircleDiaeresis_](_CircleDiaeresis_.aplo)|``|but handling empties|
|[_Diaeresis](_Diaeresis.aplo)|`¨`|handling empty arrays with failing prototype|
|[_Slash](_Slash.aplo)|`/`|only reduce first|
2 changes: 1 addition & 1 deletion RightShoe.aplf
@@ -1,4 +1,4 @@
RightShoe←{ ⍝ ⊃ just ⎕IO
RightShoe←{ ⍝ ⊃ just ⎕IO
⍺←⊢
⎕IO←0
⍺⊃⍵
Expand Down
5 changes: 3 additions & 2 deletions _BackSlash.aplo
@@ -1,4 +1,5 @@
_BackSlash←{ ⍝ \ scan first and outer product
0=⎕NC'⍺':⍺⍺⍀⍵
_BackSlash←{ ⍝ \ scan first and outer product
0=⎕NC'⍺':⍺⍺⌿_Diaeresis↑∘⍵¨(~⎕IO)+⍳≢⍵
0∩shape←∊⍴¨⍺ ⍵::shape⍴⎕NS ⍬
⍺∘.⍺⍺ ⍵
}
5 changes: 3 additions & 2 deletions _Diaeresis.aplo
@@ -1,5 +1,6 @@
_Diaeresis←{ ⍝ ¨ ignoring empty arrays
_Diaeresis←{ ⍝ ¨ handling empty arrays with failing prototype
⍺←⊢
(0∘∊∘∊∧0∊≢¨)⍴¨⍺ ⍵ ⍵:⍵
r←⍺⊢¨⍵
0⍴⍨0∊⍴r::(⍴r)⍴⎕NS ⍬
⍺ ⍺⍺¨⍵
}
7 changes: 7 additions & 0 deletions _JotDiaeresis_.aplo
@@ -0,0 +1,7 @@
_JotDiaeresis_←{ ⍝ ⍤ but handling empties
rank←⌽3⍴⌽⍵⍵
0=⎕NC'⍺':↑⍺⍺ _Diaeresis⊂⍤(⊃rank)⊢⍵
a←⊂⍤(⊃1⌽rank)⊢⍺
w←⊂⍤(⊃2⌽rank)⊢⍵
↑⍺ ⍺⍺ _Diaeresis ⍵
}
9 changes: 9 additions & 0 deletions prime.apln
Expand Up @@ -2,6 +2,15 @@
⎕IO←1 ⋄ ⎕ML←1
Err←{⍞←⍵,⎕UCS 13}

∇ {text}←UpdateReadme path;head;tail;file
file←path,'/README.md'
text←⊃⎕NGET file 1
head←(3↑¨text)⍳⊂'| -'
tail←'⎕\S+'⎕R'`&`'{'|[',⍵,'](',⍵,'.apl',(' fo'⊃⍨⊃##.⎕NC ⍵),')',⊃'⍝ (.) (.*)'⎕S'|`\1`|\2|'⊃##.⎕NR ⍵}¨##.⎕NL-3 4
text←tail,⍨head↑text
file 1 ⎕NPUT⍨⊂text

∇ {ns}←Repl target;input;n;v
2022⌶⍣('W'=⊃⊃# ⎕WG'APLVersion')⊤⍨⍬
:If ×≢target
Expand Down

0 comments on commit f6918b1

Please sign in to comment.