Skip to content

Instantly share code, notes, and snippets.

;; -*- Mode: Lisp; Syntax: Common-Lisp -*-
;;; Package Management
(in-package :cl-user)
(defpackage :hige
(:use :cl
:drakma
:cl-ppcre)
#+ABCL (:shadow :y-or-n-p)

Using Travis CI with Roswell

Travis CI is the most prevalent cloud CI service. Though it has no Common Lisp support officially, by using Roswell, you can test your Common Lisp product with a few efforts.

WARNING: This document is based on Roswell v0.0.3.42 (not released yet) or above.

Enabling Travis CI

To use Travis CI, you must sign up and enable testing for your repository at your profile page.

@priyadarshan
priyadarshan / which.lisp
Last active August 29, 2015 14:27 — forked from fukamachi/which.lisp
which -- check if a command is available on the working environment
(defun which (command)
(handler-case
(let* ((result (with-output-to-string (s)
(uiop:run-program `("which" ,command)
:output s
:error-output *error-output*)))
(newline-pos
(position-if (lambda (char)
(or (char= char #\Newline)
(char= char #\Return)))
@priyadarshan
priyadarshan / clhs.ros
Last active August 29, 2015 14:27 — forked from fukamachi/clhs.ros
A Roswell script for opening HyperSpec page describing a given symbol in the default browser.
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
#|
A Roswell script to open the HyperSpec page of a specified symbol in the default browser.
$ ros starter.ros
While evaluating the form starting at line 127, column 0
of #P"/usr/local/share/common-lisp/source/roswell/init.lisp":
Unhandled SB-INT:C-STRING-DECODING-ERROR in thread #<SB-THREAD:THREAD
"main thread" RUNNING
{1002D77563}>:
:UTF-8 c-string decoding error:
the octet sequence #(200 23) cannot be decoded.
Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1002D77563}>
@priyadarshan
priyadarshan / Dockerfile
Last active August 29, 2015 14:27 — forked from fukamachi/Dockerfile
Dockerfile for building an image of Ubuntu with Roswell
FROM ubuntu
MAINTAINER Eitaro Fukamachi <[email protected]>
LABEL Description="Ubuntu with Roswell, Common Lisp implementation manager"
RUN apt-get update && apt-get install -y autotools-dev automake libcurl4-gnutls-dev curl make
RUN curl -SL https://github.com/snmsts/roswell/archive/release.tar.gz \
| tar -xzC /tmp/ \
&& cd /tmp/roswell-release \
&& sh bootstrap \
@priyadarshan
priyadarshan / 00-vector-case.lisp
Last active August 29, 2015 14:27 — forked from fukamachi/00-vector-case.lisp
A fast sequence matching macro
(ql:quickload :alexandria)
(import '(alexandria:ensure-cons alexandria:once-only))
(defmacro vector-case (vec-and-options &body cases)
(destructuring-bind (vec &key (start 0) end case-insensitive)
(ensure-cons vec-and-options)
(let ((otherwise (gensym "otherwise")))
(labels ((case-candidates (el)
(if (and case-insensitive
(characterp el))
@priyadarshan
priyadarshan / a.cl
Last active August 29, 2015 14:27 — forked from fukamachi/a.cl
; $ sbcl --load a.cl --eval '(sb-ext:save-lisp-and-die "a.out" :toplevel #'\''main :executable t)' && time ( echo 100000000 | ./a.out > /dev/null )
; ( echo 100000000 | ./a.out > /dev/null; ) 10.75s user 0.15s system 99% cpu 10.931 total
; $ sbcl --version
; SBCL 1.2.6
(defun main ()
(declare (optimize (speed 3) (debug 0) (safety 0) (compilation-speed 0)))
(let* ((n (1+ (the fixnum (read))))
(is-prime (make-array n :element-type 'boolean :initial-element t)))
@priyadarshan
priyadarshan / libbcrypt.rb
Last active August 29, 2015 14:27 — forked from fukamachi/libbcrypt.rb
libbcrypt.rb
require "formula"
class Libbcrypt < Formula
homepage "https://github.com/Rudolph-Miller/openwall-bcrypt"
url "https://github.com/Rudolph-Miller/openwall-bcrypt/archive/53444382b1f03f41f8757493f26f6eae66320d02.tar.gz"
version '1.1'
sha1 "6ad0f93367e7036e4c4c876d44c39cc00bbb584f"
def install
system "make", "library"
ext = OS.mac? ? 'dylib' : 'so'
@priyadarshan
priyadarshan / parser-utils.lisp
Last active August 29, 2015 14:27 — forked from fukamachi/parser-utils.lisp
Common Lisp utilities for parsing a sequence
(in-package :cl-user)
(defpackage parser-utils
(:use :cl)
(:import-from :alexandria
:with-gensyms)
(:export :with-array-parsing
:redo
:gonext
:goto))
(in-package :parser-utils)