💾 Archived View for oortcloud.flounder.online › junk › Bsugar.gmi captured on 2024-03-21 at 14:49:41. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-02-05)

-=-=-=-=-=-=-

	x @ p $ d <=> x $ d @ p		NB. floats to make defs work

	unicode subs
.	(size,sym)

-	sym		⨩
&	asym	⋀

^			⊻
|			∨
'			⊙

	x =?= y		NB. test (also x <?= y?)

	"strings"
	c </ p /> a	<=> (c @ True :: a @ False)p
	sections (op) (nm op) (op nm)

(x $ p<-s :: q<-t)		p:q <- s \zip t
(x $ p<-s !! q<-t)		p:q <- s \diag t
(x $ p<-s // q<-t)		cartesian

	_[x]	quote
	_{x}	splice

	⟨x⋮e⋮p⟩  ⟨x⋮p⟩
	
	V%?(pre,post)
	V%!{pre:(,[node,prvs]) | seen:(%{node})}

operator precedence

to use an operator as an argument, wrap in parens: reduce (+)

to use a symbol as an operator, prefix with backslash: x \op y

everything is a binary operator; a traditional call foo(a,b,c) parses as:

<|
├─foo
└─,
  ├─,
  │ ├─a
  │ └─b
  └─c
~~
<=> ==>
$ $@
// !! ::
::= ?= := <-
@ |> <|
/> </
<> == <= >= < >
' ^ | &
!: :
\\ ?? $
; ,
|.. ,..
'' ^^ || &&
~ ->
- + % / *  **
%! %* %?
# ` .

right associative:

==> $@ <| -> // ** #

(|) normally distributes through every operator in sight, the exceptions being:

<=> ==>
::= := 
<> == <= >= < >
!: :
~ ->