« first day (1313 days earlier)      last day (1347 days later) » 

12:07 AM
is there (yet) a way to do something like nameclasses using dicts or similar?

⟨"foo":{𝕩+1}⟩

the reason im thinking is I have a group of similarly connected functions, but I only want to expose a few of them as callable
 
 
1 hour later…
1:22 AM
@cannadayr No, although there might be in the future. You can still do that sort of enclosure with a block returning a list of functions, but it's a bit clumsy:
⟨F,G⟩ ← {
  a←2
  F←{a+↩𝕩}
  G←{a×↩𝕩}
  ⟨F,G⟩
}
In dzaima/BQN you might need a v: header on that block to make it an immediate block instead of a function.
 
 
10 hours later…
11:10 AM
Hello, does anyone grow fruits here?
 
@Razetime You mean like literally have trees?
 
11:40 AM
@Adám yes, real trees.
We grow bananas here.
 
Well, you're in India. My neighbour grows some (botanical) fruits, and even has an olive tree (in London!), but no, not me. Anyway, that's probably only on-topic in The Garden Shed.
 
 
3 hours later…
2:40 PM
fun stuff
I figured I might as well ask since this is an orchard, after all.
 
ngn
@Razetime i'm spending the summer in the country, and we have some trees in the yard here, including apples. a literal apple orchard :)
 
3:41 PM
I see ngn is very dedicated to APLs
having his own clone of the APL orchad
 
ngn
this one existed before apl was invented :)
 
4:21 PM
woah
older than 1970's?
amazing
non-serious talk aside, how do I box a 2d array with customized characters?
like
 
@Razetime What did you search APLcart for?
 
+---+---+
| 1 | 2 |
+---+---+
like that
instead of general boxing
┌→──────────────────┐
    │     ┌→──┐ ┌→────┐ │
    │ 1 a │abc│ ↓1 2 3│ │
    │   - └───┘ │4 5 6│ │
    │           └~────┘ │
    └∊──────────────────┘
I could do it manually
like repeating +--- x number of times and stuff like that
just wondering if there's a simpler way
 
@Razetime Like this?
      'box'⎕CY'dfns'
      ⍬1 1box '12'
+-+-+
|1|2|
+-+-+
@Razetime Do you mean a full boxing functionality, just ASCII-only?
 
5:10 PM
Yes, exactly!
Thanks for the help
Bit late here, good night
 
○/
 
@Adám (for a moment there i read that as as one-eyed ":/" lol)
 
That'd be ./ no?
CMC : Coolest use of inner/outer product ∘./ or f./
 
@Adám that's 2-eyed minus one. ○/ is natively one-eyed
 
5:27 PM
○/ ⍝ annoyed cyclops
 
 
2 hours later…
7:38 PM
Question: If ⊤ or ⊥⍣¯1 can end up representing its right argument in two ways, how does it choose which one to use? For example, if my "base" for representation is prime numbers, with each column being the largest prime number that is less than or equal to the sum of the primes to the right, plus 1, the rightmost four places will be 7 3 2 1. So, 'three' can be represented as 1 1 or as 1 0 0. How does APL decide which to use - or will it throw an error due to ambiguity?
 
@JeffZeitlin it chooses a result r such that ∧/0≤r and ∧/r<⍺ (or something similar; ignoring negative numbers in for simplicity)
 
So that implies that it will choose 1 1 rather than 1 0 0, if I'm understanding you correctly?
 
for the behavior is decided by the spec, but technically (unless its exact behavior is documented somewhere) ⊥⍣¯1 could return anything for which ⍵≡⍺⊥⍺⊥⍣¯1⊢⍵
@JeffZeitlin i don't quite understand for what expression are you asking that
 
Consider the example I described - I want to represent 3 in a base where the rightmost four columns are, as given, 7 3 2 1. There are two possible ways of representing 3 in that system: 1 1 or 1 0 0.
Either is technically correct - but which one should I expect APL to return?
(The particular example is of interest because the system comes up in one of Robert Forward's novels about a trip to the Barnard's Star system and the aliens the travellers find there.)
 
7:54 PM
@JeffZeitlin with a left argument of 7 3 2 1, 3 isn't encoded neither as 0 0 1 1 nor 0 1 0 0
 
How not?
 
@JeffZeitlin that's 2
 
It shouldn't be.
 
ngn
@JeffZeitlin you may be conflating ⊥ with +.×
 
Unless I'm misunderstanding how the base representation functions work... 7 3 2 1 are supposed to be place values.
IOW, 0 0 0 1 = 1; 0 0 1 0 =2; 0 0 1 1 = 3 - but so does 0 1 0 0; 0 1 0 1 = 4; 0 1 1 0 = 5; und so weiter.
 
7:59 PM
@JeffZeitlin 1↓1,⍨⌽×\⌽7 3 2 1 are the place values
 
Now you've lost me...
 
remember that 10 10 10 10 10⊤123 is 0 0 1 2 3 - the 3rd digit certainly doesn't have a value of 10, but 100!
 
Right... I think I see where I'm going wrong.
But I'm not sure how to correct it...
 
8:13 PM
(Probably functions REP and DEREP that take actual place values as the 'base' argument rather than multipliers)
 
@JeffZeitlin But as you've shown place values of 7 3 2 1 lead to an ambiguous representation. While you could make encode handle it using the ratios between those numbers for the bases, it seems better to just say you want to solve the problem that 7 3 2 1+.×a is 3. If you just want integer solutions, that makes it a linear diophantine equation.
 
@Marshall - Yes, the ambiguity is built in to the "system" as emergent behavior because of how the prime numbers are distributed in the natural numbers, and how successive places are defined. I don't actually have a problem with the inherent ambiguity, but if I'm going to be playing with the system in code, I need to either know how it would be handled [i.e., which representation of an ambiguous number will be used] or I have to write my own code to define which is chosen.
I don't actually have a bias as to which, but I'd prefer to know before I decide whether own-coding might be more appropriate.
 
8:40 PM
@JeffZeitlin Represent probably isn't useful. All it does is move from lower to higher place values, carrying as many whole units as possible and adding the remainder to the result. For 7 3 2 1 you have to use a left argument of 0,2÷/7 3 2 1, but since that vector isn't all integers the remainders can be non-integers even if the argument's an integer.
      (0,2÷/7 3 2 1)⊤5
0 1 0.5 1
 
@Marshall - Yeah, I see. And I think that I'm going to end up having to own-code the functions to handle the case where the place values turn out not to be simple integer powers of a single number...
 
 
3 hours later…
11:51 PM
CMC: Can you modify the source code of dfns.X as little as possible so that it returns all answers rather than one answer?
 

« first day (1313 days earlier)      last day (1347 days later) »