« first day (1897 days earlier)      last day (760 days later) » 

12:04 AM
@GreenSaguaro really you need just (⊂⍬); is an empty list, but ⍬⍬ is a 2-item list of empty lists; ~⍬ removes all items that are in the empty list (but it's empty, so you remove nothing)
 
There’s also compress.
⋄ F←{2|⍵}⋄{(F⍵)/⍵}⍳10
 
@doug 1 3 5 7 9
 
and now it's gone full circle - compress to ~⊂⍬ to ~⍬⍬ to ~⊂⍬ to compress
 
I wanted to do a fork but the / is ambiguous.
 
 
1 hour later…
1:16 AM
Are nullary functions possible in Dyalog APL? I have an action that does not take parameters that generates random data, and I want to run it multiple times
 
 
2 hours later…
2:46 AM
⋄{17} 2
 
@doug 17
 
Yes but you need to call them with an arbitrary argument.
⋄{17}
 
@doug (1 trailing line)
{17}

␄
 
 
2 hours later…
4:25 AM
@doug Ah, I see. Thank you.
 
5:08 AM
@GreenSaguaro @doug Yes, but not dfns or tacit functions; only tradfns:
      ∇r←rand10
       r←?10
      ∇
      rand10
1
      rand10
3
      rand10
4
      rand10
1
      rand10
5
@smartmic Hi there. Interested in APL?
 
Just stumbled on Nial. Anyone familiar?
- https://en.wikipedia.org/wiki/Nial
- https://aplwiki.com/wiki/Nial
- https://www.nial-array-language.org/
 
@AviFS #nial on the APL Farm is relatively active.
 
@Adám Ah neat, will have to check it out later.
The APL wiki mentions a couple things as being noteworthy, but it doesn't mention the error handling. It looks like Nial has a native "fault" data type. Which means you can do:
     1 ÷ 0
?div
     5 ÷ 5 10 0 8
1. 0.5 ?div 0.625
Which means you can even error handle in the matrix-based style with something like:
     0@(?div∘=)5÷5 10 1 8
1 0.5 0 0.625
 
5:33 AM
By all means, feel free to expand this (and anything) on the wiki.
 
Roughly translated into APL from:
     % A basic divide by zero error: ;
     1 / 0
?div
     % Errors are values called faults.
       This allows for powerful error handling: ;
     5 / 5 10 0 8
1. 0.5 ?div 0.625
     each (op x (if isfault x then 0 else x endif)) (5 / 5 10 0 8)
1. 0.5 0 0.625

     % You can also define custom faults using 'fault': ;
     fault 'this_is_an_error'
?this_is_an_error

     % Or by using a fault literal: ;
     ?this_is_an_error
?this_is_an_error
@Adám Good point. Is this way of error handling with a native vectorizable data type a known idea in the APL world?
Does Dyalog (or bqn/ngn/extended/j/k) have an analog?
 
 
2 hours later…
7:45 AM
@AviFS Well, NARS2000 and J can return infinities and indeterminates, while k has nulls…
 
 
4 hours later…
12:02 PM
@Adám @doug Thank you for your help with my unmatched bracket question!
> You can traverse and update a state with {state←initial_value ⋄ expression state⊣{traverser}¨⍵}
This state machine form is neat, thanks!
 
12:28 PM
CMC : Write an expression which, under Dyalog Unicode, returns (scalar or vector) but under Classic returns ... without your code containing the character.
Additional restriction: Under Classic, you must not cause the character to exist at any time, so evaluating ⎕UCS 8230 isn't allowed under Classic.
 
 
1 hour later…
1:44 PM
Announcement: New job opening at Dyalog Ltd.
 
 
4 hours later…
5:45 PM
@Adám does classic edition has ⎕AVU?
 
 
1 hour later…
7:01 PM
@Adám Hi @Adám, yes, definitely! I am just looking around the various resources for learning APL. I was using J for some experiments a while ago but felt like giving the original a try. Have not regretted it so far. I mean I just spend a few hours getting my feet wet in the language but I am surprised how much I like the symbol notation much more than its ASCII equivalent in J…
 
7:14 PM
@LdBeth Yes. In fact, that's the only version where it is really important.
@smartmic Great. Let us know if you need anything in particular. I trust you've found apl.wiki/learning_resources?
 

« first day (1897 days earlier)      last day (760 days later) »