Re:AMA: Explaining my 750 line compiler+runtime designed to ...
by Avshalom on Sunday March 05, 2017 @08:43PM
(#13800144)
ιR creates an array 1...R
1↓ drops the first element of whatever is to the right (1...R)
R← just assigns the thing to the right to R, so now R is a variable containing the integers 2...R
R∘.×R creates a 2d matrix of every element in R multiplied by every other element in R
R∊ takes whatever's to the left (that matrix) and sees if any value in R is in that matrix. it spits out an array that is like 1 0 0 1 0 1 1 0, where the ones correspond to elements in R that are also in the matrix
~ just reverses that list so now we have an array thats like 0 1 1 0 1 0 0 1 which corresponds to elements in R that can't be created by multiplying any two elements of R together
/ goes through and only returns values of R that correspond to those 1's
1↓ drops the first element of whatever is to the right (1...R)
R← just assigns the thing to the right to R, so now R is a variable containing the integers 2...R
R∘.×R creates a 2d matrix of every element in R multiplied by every other element in R
R∊ takes whatever's to the left (that matrix) and sees if any value in R is in that matrix. it spits out an array that is like 1 0 0 1 0 1 1 0, where the ones correspond to elements in R that are also in the matrix
~ just reverses that list so now we have an array thats like 0 1 1 0 1 0 0 1 which corresponds to elements in R that can't be created by multiplying any two elements of R together
/ goes through and only returns values of R that correspond to those 1's
the flow is like this: