Alternative syntax for Python's lambda
Alternative syntax for Python's lambda
Posted Mar 5, 2021 19:39 UTC (Fri) by cpitrat (subscriber, #116459)In reply to: Alternative syntax for Python's lambda by aeline
Parent article: Alternative syntax for Python's lambda
Posted Mar 5, 2021 21:35 UTC (Fri)
by nybble41 (subscriber, #55106)
[Link] (4 responses)
<Multi_key> <g> <r> <l> : "λ" U03BB # GREEK SMALL LETTER LAMBDA
Here are the equivalents for lowercase a-z: αβ_δεφγηιθκλμνοπχρστυ_ωξψζ ('c' and 'v' have no corresponding entries and so were replaced with '_').
Unfortunately Windows doesn't have any built-in equivalent to XCompose. I have a few char codes memorized for that, but λ isn't one of them.
To make this work under Linux with X11 you need to create the file ~/.XCompose, set GTK_IM_MODULE=xim and QT_IM_MODULE=xim, and assign some key to the Multi_key function in your keyboard settings. I use the Menu key for Multi_key but you might prefer something else.
[0] https://jessemcdonald.info/gogs/nybble/compose-config/raw...
Posted Mar 5, 2021 21:43 UTC (Fri)
by mpr22 (subscriber, #60784)
[Link]
Posted Mar 5, 2021 23:58 UTC (Fri)
by mbunkus (subscriber, #87248)
[Link]
Posted Mar 6, 2021 9:55 UTC (Sat)
by LtWorf (subscriber, #124958)
[Link] (1 responses)
I don't think the env vars you are exporting are needed. I do not have them.
It used to be that GTK did not support longer sequences than 2 so I had to write them in kwrite and copy paste, but it seems to be working now for a while.
Posted Mar 8, 2021 23:17 UTC (Mon)
by nybble41 (subscriber, #55106)
[Link]
Yes, that's how I have it configured. In other desktop environments you can use "setxkbmap -option compose:menu" (plus your normal model/layout options) for the same effect.
> I don't think the env vars you are exporting are needed.
If you don't set them then both Gtk and Qt will pick a default input method. If that happens to be XIM then everything will work just fine. If not, the .XCompose file might be ignored; it depends on which input method was chosen. IBUS has some support for reading .XCompose in recent versions. I'm not sure about the others.
Posted Mar 6, 2021 1:49 UTC (Sat)
by aeline (guest, #144768)
[Link] (1 responses)
Posted Mar 6, 2021 1:54 UTC (Sat)
by aeline (guest, #144768)
[Link]
Posted Mar 10, 2021 3:50 UTC (Wed)
by pj (subscriber, #4506)
[Link] (1 responses)
U+39b is greek capital lambda
...or one of the other 10ish mathematical lambda characters? (list at https://unicode-table.com/en/search/?q=lambda )
Is there a convention for this? is one more canonical than the others?
Posted Mar 10, 2021 9:12 UTC (Wed)
by mpr22 (subscriber, #60784)
[Link]
Posted Mar 10, 2021 11:28 UTC (Wed)
by fredrik (subscriber, #232)
[Link]
Posted Mar 22, 2021 16:11 UTC (Mon)
by hummassa (subscriber, #307)
[Link]
Alternative syntax for Python's lambda
And the equivalents for uppercase A-Z: ΑΒ_ΔΕΦΓΗΙΘΚΛΜΝΟΠΧΡΣΤΥ_ΩΞΨΖ.
Also many useful symbols: → ⇒ ↑ ↓ × ÷ « » ⋄ ⊛ Ⓧ ¾ ⅞ ☺ € ₡ ¢ ∀ ∃ ±
Alternative syntax for Python's lambda
Alternative syntax for Python's lambda
Alternative syntax for Python's lambda
Alternative syntax for Python's lambda
Alternative syntax for Python's lambda
Alternative syntax for Python's lambda
This is really nice for following mathematics/language papers. A snippet from a recent project:
;; Values
(v ::= n
b
∅ ;; Unit
(λ (x : t) e) ;; Value Abstraction
(Λ x e)) ;; Type Abstraction
Alternative syntax for Python's lambda
U+3bb is greek small letter lambda
U+1d27 is greek letter small capital lambda
Alternative syntax for Python's lambda
In Gnome, and terminals like Alacritty, you use the generic unicode character shortcut, which is Ctrl + Shift + u followed by the unicode code point for lambda which is 03BB, which can be abreviated to 3bb, so basically:
Alternative syntax for Python's lambda
Ctrl + Shift + u 3 b b Space
Easy as pie! 🙂
Alternative syntax for Python's lambda
<Ctrl+k>*l
:help digraphs
