11 karma · joined Sep 6, 2014 (12y ago) · 7 submissions
comment 10y ago · link · parent
$ sbcl
This is SBCL 1.2.4.debian, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
> (ql:quickload 'infix)
; Loading package
(INFIX)
> #i(1 + 1) ; addition
2
> #i(2^^128) ; exponentiation
340282366920938463463374607431768211456
> (defun factorial (x)
#i(if x == 0 then
1
else
x * factorial(x-1))) ; infix function call
FACTORIAL
> (factorial 5)
120
> #i(factorial(5) / factorial(6))
1/6
> '#i((a + b) * (c + d)) ; Put a ' before the #i() to see what code is generated
(* (+ A B)
(+ C D))
--[1] - https://www.quicklisp.org/beta/ [2] - Don't know if there is a similar package for Scheme.
comment 11y ago · link · parent
You can also use those spreadsheets as input for pieces of code so you perform some analysis on their data.
--
[1] - http://orgmode.org/
comment 11y ago · link · parent
https://github.com/nicolargo/glances
bmon and iftop can be used to see network usage:
https://github.com/tgraf/bmon/
http://www.ex-parrot.com/pdw/iftop/
Similar to iftop there is also iotop, but instead of showing network usage, it shows disk usage:
Side note: There was a blog a couple years ago, which isn't being updated now, that would post reviews of CLI tools. Anyone that is interested in this topic should take a look at it:
https://kmandla.wordpress.com/software/
https://inconsolation.wordpress.com/ (new blog from the same person that did http://kmandla.wordpress.com)
comment 11y ago · link · parent
For example, if you save the following code[1] into a file and try to load it into SBCL, it will give a compile time error:
(ql:quickload 'defstar)
(use-package 'defstar)
(declaim (optimize (debug 3) (speed 0) (safety 3)))
(defun* factorial ((x (integer 0 *))) ;; x is an integer from 0 up to +inf
(if (zerop x)
1
(* x (factorial (1- x)))))
(defun main ()
(factorial "foo") ;; Compile time error: "foo" conflicts with its assert type UNSIGNED-BTYE
(factorial -1) ;; Compile time error: -1 conflicts with its assert type UNSIGNED-BTYE
(factorial 1.0) ;; Compile time error: 1.0 conflicts with its assert type UNSIGNED-BTYE
(factorial 0)) ;; Works
And when you load the file into SBCL you get the following error message (assuming you have Quicklisp installed): $ sbcl --load compile-time-safety.lisp
This is SBCL 1.2.7, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
To load "defstar":
Load 1 ASDF system:
defstar
; Loading "defstar"
; file: /home/rol/src/lisp/compile-time-safety.lisp
; in: DEFUN MAIN
; (FACTORIAL "foo")
;
; caught WARNING:
; Constant "foo" conflicts with its asserted type UNSIGNED-BYTE.
; See also:
; The SBCL Manual, Node "Handling of Types"
;
; compilation unit finished
; caught 1 WARNING condition
It's not as nice as Haskell's type system, but it's something :)The main problem with this sort of compile-time checking is that it's implementation dependent, so some Common Lisp implementation may not provide it. You can configure the defstar library that I used on this code so that it automatically adds calls to "(check-type ...)". But then you are back at doing run-time checking of types.
--
[1] - The defstar library can be found on Quicklisp or here: https://bitbucket.org/eeeickythump/defstar/
It's pretty much just a nicer way to write all of the "(declaim ...)" and "(declare ...)" needed to provide the most information to the Common Lisp type system.
comment 11y ago · link · parent
Doing
(setq gnus-blocked-images ".*")
will block all the images in the emails.I tested it using "https://emailprivacytester.com" and the it picked up only the DNS prefetch link/anchor which I assume are due to my ISP and not Gnus.
comment 11y ago · link · parent
As far as I know, only the Lisp community has something similar to cpantesters in their cl-test-grid project.
On the other hand nowadays a language community could probably set up something similar to cpantesters using travis so hopefully we'll see more of those sort of systems in the future.
--
[1] - If you want to play buzzword bingo you can think about cpantesters as a distributed, fault-tolerant, self-organizing, volunteered run, cross-platform continuous integration platform that is free to end-users.