#mlist — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #mlist, aggregated by home.social.
-
@ksaj
(defun lazy-hax0r-p (x)
(let* ((7s (scan-range :from 7 :by 7))
(7m (mask 7s))
(191s (scan-range :from 191 :by 191))
(191m (mask 191s))
(m (#Mand 7m 191m)))
(collect-nth x m)))Attempt two ;p
EDIT: THREE
Basically, Series doesn't optimize out consing. #Mand doesn't cons, but #mlist does.
Connection:
Series and python are the same age. -
@ksaj
(defun lazy-hax0r-p (x)
(let* ((7s (scan-range :from 7 :by 7))
(7m (mask 7s))
(191s (scan-range :from 191 :by 191))
(191m (mask 191s))
(m (#Mand 7m 191m)))
(collect-nth x m)))Attempt two ;p
EDIT: THREE
Basically, Series doesn't optimize out consing. #Mand doesn't cons, but #mlist does.
Connection:
Series and python are the same age. -
@ksaj
(defun lazy-hax0r-p (x)
(let* ((7s (scan-range :from 7 :by 7))
(7m (mask 7s))
(191s (scan-range :from 191 :by 191))
(191m (mask 191s))
(m (#Mand 7m 191m)))
(collect-nth x m)))Attempt two ;p
EDIT: THREE
Basically, Series doesn't optimize out consing. #Mand doesn't cons, but #mlist does.
Connection:
Series and python are the same age. -
@ksaj
(defun lazy-hax0r-p (x)
(let* ((7s (scan-range :from 7 :by 7))
(7m (mask 7s))
(191s (scan-range :from 191 :by 191))
(191m (mask 191s))
(m (#Mand 7m 191m)))
(collect-nth x m)))Attempt two ;p
EDIT: THREE
Basically, Series doesn't optimize out consing. #Mand doesn't cons, but #mlist does.
Connection:
Series and python are the same age. -
@ksaj
(defun lazy-hax0r-p (x)
(let* ((7s (scan-range :from 7 :by 7))
(7m (mask 7s))
(191s (scan-range :from 191 :by 191))
(191m (mask 191s))
(m (#Mand 7m 191m)))
(collect-nth x m)))Attempt two ;p
EDIT: THREE
Basically, Series doesn't optimize out consing. #Mand doesn't cons, but #mlist does.
Connection:
Series and python are the same age. -
-
-
-
-
-
@fosskers
(defun eg (x)
(let* ((nos (scan-range))
(fizz-src (series 'fizz))
(buzz-src (series 'buzz))
(by3s (scan-range :from 0 :by 3))
(by5s (Scan-range :from 0 :by 5))
(fizzes (mask by3s))
(buzzes (mask by5s))
(fizz/buzzes (#Mlist (#Mand fizzes fizz-src)
(#Mand buzzes buzz-src))))
(list (collect-nth x (#Mand fizzes fizz-src))
(collect-nth x (#Mand buzzes buzz-src))
(collect-nth x nos))))
Oh if I don't tell it to cons, it's faster than loop. -
@fosskers
(defun eg (x)
(let* ((nos (scan-range))
(fizz-src (series 'fizz))
(buzz-src (series 'buzz))
(by3s (scan-range :from 0 :by 3))
(by5s (Scan-range :from 0 :by 5))
(fizzes (mask by3s))
(buzzes (mask by5s))
(fizz/buzzes (#Mlist (#Mand fizzes fizz-src)
(#Mand buzzes buzz-src))))
(list (collect-nth x (#Mand fizzes fizz-src))
(collect-nth x (#Mand buzzes buzz-src))
(collect-nth x nos))))
Oh if I don't tell it to cons, it's faster than loop. -
@fosskers
(defun eg (x)
(let* ((nos (scan-range))
(fizz-src (series 'fizz))
(buzz-src (series 'buzz))
(by3s (scan-range :from 0 :by 3))
(by5s (Scan-range :from 0 :by 5))
(fizzes (mask by3s))
(buzzes (mask by5s))
(fizz/buzzes (#Mlist (#Mand fizzes fizz-src)
(#Mand buzzes buzz-src))))
(list (collect-nth x (#Mand fizzes fizz-src))
(collect-nth x (#Mand buzzes buzz-src))
(collect-nth x nos))))
Oh if I don't tell it to cons, it's faster than loop. -
@fosskers
(defun eg (x)
(let* ((nos (scan-range))
(fizz-src (series 'fizz))
(buzz-src (series 'buzz))
(by3s (scan-range :from 0 :by 3))
(by5s (Scan-range :from 0 :by 5))
(fizzes (mask by3s))
(buzzes (mask by5s))
(fizz/buzzes (#Mlist (#Mand fizzes fizz-src)
(#Mand buzzes buzz-src))))
(list (collect-nth x (#Mand fizzes fizz-src))
(collect-nth x (#Mand buzzes buzz-src))
(collect-nth x nos))))
Oh if I don't tell it to cons, it's faster than loop. -
@fosskers
(defun eg (x)
(let* ((nos (scan-range))
(fizz-src (series 'fizz))
(buzz-src (series 'buzz))
(by3s (scan-range :from 0 :by 3))
(by5s (Scan-range :from 0 :by 5))
(fizzes (mask by3s))
(buzzes (mask by5s))
(fizz/buzzes (#Mlist (#Mand fizzes fizz-src)
(#Mand buzzes buzz-src))))
(list (collect-nth x (#Mand fizzes fizz-src))
(collect-nth x (#Mand buzzes buzz-src))
(collect-nth x nos))))
Oh if I don't tell it to cons, it's faster than loop. -
I cannot say this is the easiest thing I have ever written. #lisp
(defun fizzbuzz-of (x)
(let* ((nos (scan-range))
(fizz-src (series 'fizz))
(buzz-src (series 'buzz))
(by3s (scan-range :from 0 :by 3))
(by5s (Scan-range :from 0 :by 5))
(fizzes (mask by3s))
(buzzes (mask by5s))
(fizz/buzzes (#Mlist (#Mand fizzes fizz-src)
(#Mand buzzes buzz-src))))
(or (collect (choose-if #'identity
(scan (collect-nth x fizz/buzzes))))
(list (collect-nth x nos))))) -
I cannot say this is the easiest thing I have ever written. #lisp
(defun fizzbuzz-of (x)
(let* ((nos (scan-range))
(fizz-src (series 'fizz))
(buzz-src (series 'buzz))
(by3s (scan-range :from 0 :by 3))
(by5s (Scan-range :from 0 :by 5))
(fizzes (mask by3s))
(buzzes (mask by5s))
(fizz/buzzes (#Mlist (#Mand fizzes fizz-src)
(#Mand buzzes buzz-src))))
(or (collect (choose-if #'identity
(scan (collect-nth x fizz/buzzes))))
(list (collect-nth x nos))))) -
I cannot say this is the easiest thing I have ever written. #lisp
(defun fizzbuzz-of (x)
(let* ((nos (scan-range))
(fizz-src (series 'fizz))
(buzz-src (series 'buzz))
(by3s (scan-range :from 0 :by 3))
(by5s (Scan-range :from 0 :by 5))
(fizzes (mask by3s))
(buzzes (mask by5s))
(fizz/buzzes (#Mlist (#Mand fizzes fizz-src)
(#Mand buzzes buzz-src))))
(or (collect (choose-if #'identity
(scan (collect-nth x fizz/buzzes))))
(list (collect-nth x nos))))) -
I cannot say this is the easiest thing I have ever written. #lisp
(defun fizzbuzz-of (x)
(let* ((nos (scan-range))
(fizz-src (series 'fizz))
(buzz-src (series 'buzz))
(by3s (scan-range :from 0 :by 3))
(by5s (Scan-range :from 0 :by 5))
(fizzes (mask by3s))
(buzzes (mask by5s))
(fizz/buzzes (#Mlist (#Mand fizzes fizz-src)
(#Mand buzzes buzz-src))))
(or (collect (choose-if #'identity
(scan (collect-nth x fizz/buzzes))))
(list (collect-nth x nos))))) -
I cannot say this is the easiest thing I have ever written. #lisp
(defun fizzbuzz-of (x)
(let* ((nos (scan-range))
(fizz-src (series 'fizz))
(buzz-src (series 'buzz))
(by3s (scan-range :from 0 :by 3))
(by5s (Scan-range :from 0 :by 5))
(fizzes (mask by3s))
(buzzes (mask by5s))
(fizz/buzzes (#Mlist (#Mand fizzes fizz-src)
(#Mand buzzes buzz-src))))
(or (collect (choose-if #'identity
(scan (collect-nth x fizz/buzzes))))
(list (collect-nth x nos)))))