Diane's Lasagne Problem
Making Lasagne Participants in the SA2 Performance Tuning workshop at the Dyalog ’18 User Meeting were encouraged to bring their own problems for the group to work on. Diane Hymas of ExxonMobil brought a good one. The one-liner computation is as follows: lasagne0 ← {groups {+⌿⍵}⌸ amts ×[⎕io] spices[inds;]} where n ← 8e5 spices ← […]
Permuting Internal Letters
Friday Afternoon It’s something of a custom in Dyalog to send a “fun” e-mail to the group on Friday afternoons. My gambit for this past Friday was: x ←’ according to research it doesn”t matter’ x,←’ what order the letters in a word are’ x,←’ the human mind can still read it’ x,←’ the only […]
50847534
⎕io←0 throughout. I was re-reading A Mathematician’s Apology before recommending it to Suki Tekverk, our summer intern, and came across a statement that the number of primes less than 1e9 is 50847478 (§14, page 23). The function pco from the dfns workspace does computations on primes; ¯1 pco n is the number of primes less […]
Constructions
Suki Tekverk, a summer intern, spent the last two weeks here studying APL. She will be a high school senior next September and is adept in math, so in addition to APL we also considered some math problems, proofs, and proof techniques, including the following: Given line segments x and y, construct (using compass and […]
The Story of a Summer Intern
by Suki Tekverk As a born and raised New Yorker, I thought I had seen it all, but two short weeks spent in Vancouver with Roger Hui and his family proved me very wrong! I went from being at the top of the totem pole to one of the most clueless people around. Luckily, these […]
Loops, Folds and Tuples
For-loops Given an initial state defined by a number of variables, a for-loop iterates through its argument array modifying the state. A←… ⋄ B←… ⋄ C←… ⍝ initial state :For item :In items ⍝ iterating through array “items” A←A … item ⍝ new value for A depending on item C←C … A … item ⍝ new value for C depending on A and item … ⍝ state updated :EndFor A B C ⍝ […]
Type Comments
I’ve taken to commenting the closing brace of my inner dfns with a home-grown type notation pinched from the Functional Programming community: dref←{ ⍝ Value for name ⍵ in dictionary ⍺ names values←⍺ ⍝ dictionary pair (names⍳⊂⍵)⊃values ⍝ value corresponding to name ⍵ } ⍝ :: Value ← Dict ∇ Name I keep changing my […]
Response to Name Colouring for Dfns
This post contains comments to John Scholes’ post on name colouring; please continue to post any further comments with the original post. This is a very interesting topic – as the discussion has already showed, there are many different needs. It seems to me that some of the suggestions that have been made are forms of highlighting […]
Name Colouring for Dfns
APL is sometimes criticised because expressions that include names cannot, in general, be parsed without knowing whether the names represent functions or variables. For example, the name thing in the expression thing⍳3 could reference an array (in which case the ⍳ is dyadic) or it could reference a function (making the ⍳ monadic). An APL […]
Do Functions Know Their Own Names?
Going back a long way when John Scholes and I were writing version 0 of Dyalog there was a big discussion about whether functions knew their own names. This discussion still surfaces, with John taking the side that they don’t and me taking the side that they do. Essentially, John would argue that after A←2, […]