libera/#commonlisp - IRC Chatlog
Search
11:20:45
phantomics
One of the most dramatic things it lets you do is for example (april-f "5 5↑¯20 ¯20↓80 80↓3/20⌽2000000 2000000⍴⍳10*10")
11:21:30
phantomics
This is creating a 2 million square matrix, rotating, stretching and cropping the entire thing, then taking the upper-left 5x5 of it
11:22:51
phantomics
Because it starts from the end and works backwards only the 25 output elements are actually computed
11:24:33
phantomics
The array restructuring functions work by processing array indices as encoded integers. For instance, if you have a 3D array whose dimensions are all under 256, its coordinates can be encoded in a 32-bit int. Coordinates (1, 2, 3) can be encoded as #x00010203 for example
11:25:52
phantomics
So for instance if you're doing a take of the array which crops off 10 elements on all sides, all you need to do is add #x000A0A0A to each coordinate value
11:26:31
phantomics
You can chain these operations together to do multiple array transforms in a single loop without writing the intermediate arrays into memory
11:28:50
phantomics
Using CLOS initialize-instance and metaclass allocator overrides, it's also possible to obviate some classes when they're created
11:29:29
phantomics
For example, 3⌽3⌽X becomes 6⌽X and ⍉⍉A becomes just A because two successive permutes cancel each other
11:59:59
bitblit1
phantomics: Not really, just random stuff. I am making a window manager called blitter-wm and other small projects like a calculator for CLOSOS.
12:05:10
bitblit1
Not really, just for myself. I was tired of StumpWM being wierd and unmaintined. Wanted a simple X window manager entirely in CL which would be super customizable. However, this was my secret preperation for making a WM for CLOSOS
12:14:01
phantomics
If you could get some workflow display logic in there would be cool, like being able to spawn collections of windows and desktops for a specific task
12:14:49
bitblit1
phantomics: Could you elaborate a little more? I would love suggestions! Also, you can be sure to add them as TODOs (issues in git repo)
12:16:55
phantomics
Say I want to define a task like video editing, which will involve the video editor, Inkscape for designing caption graphics and Audacity for creating the audio track. It will start those programs and display them in a specific defined layout with constraints based on the monitor form factor
12:18:07
phantomics
And also give a set of key shortcuts for moving between them. Another simpler workflow could be "image editing with April" where I have an Emacs window for interacting with April and an image viewer window for viewing the image I'm generating. This can be done entirely in Emacs but it could also be a workflow based on multiple desktop apps
12:20:54
phantomics
I could put a TODO but it's not very concrete as a goal, something more specific that you could improve over Gnome/KDE/xfce is configuring keyboard shortcuts for doing different things, a Lisp-based config would be great for stuff like that with unlimited options
12:30:02
phantomics
You may want to look into the Cassowary constraint solver for layout logic: https://github.com/slightlyoff/cassowary.js, https://constraints.cs.washington.edu/cassowary/
12:47:18
phantomics
Here's a discussion of Cassowary and some other algos: https://news.ycombinator.com/item?id=13124584
13:01:57
bitblit1
How do I create a macro wrapper around a function which is sensitive to keyword arguments passed to it effeciently? For example:
13:02:25
bitblit1
I have a function whose argument list looks like this: `(&key (host "") (display 0 display-p) (screen 0 screen-p))`
13:03:00
bitblit1
I want to create a macro/function which would run it in a separate thread and take the exact arguments
13:09:34
flip214
bitblit1: you can use &rest to capture all arguments and relay them on; but be aware that a macro gets _unevaluated_ arguments whereas the function gets _evaluated_ args
13:13:42
flip214
bitblit1: see the last example on http://www.lispworks.com/documentation/HyperSpec/Body/03_daf.htm