(no title)
phantomics | 5 years ago
(april-c "{⍴∪,(3⍴2*8)⊥3 1 2⍉⍵}" (opticl:read-png-file "/path/to/image.png"))
This snippet uses the opticl library to load a PNG file, and then uses April to count the number of unique colors in the image. Consider the amount of code this would take in CL.
smabie|5 years ago
phoe-krk|5 years ago
phantomics|5 years ago
But April has many ways of passing options and external data for the compiled code to operate upon, and implementing a reader macro system that would support all those parameters would be complicated and require developers to learn a bunch of new syntax in order to use April with reader macros.
phantomics|5 years ago
(april-load #P"/path/to/code.apl")
Then you can have files of pure APL code with no Lisp hanging around.
e12e|5 years ago
I don't really read APL - but isn't this just a map/reduce over the pixels? - maybe (length (remove-duplicates 'pixel-data)) or some such?
phantomics|5 years ago