Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Rename parent parameter for improved readability. | (cl:in-package #:clump-binary-tree)
;;; Make CHILD the left child of NODE.
(defgeneric link-left (node child))
;;; Make CHILD the right child of NODE.
(defgeneric link-right (node child))
;;; Remove CHILD as the left child of NODE.
(defgeneric unlink-left (node child))
;;; Remove CHILD as the right child of NODE.
(... | (cl:in-package #:clump-binary-tree)
;;; Make CHILD the left child of NODE.
(defgeneric link-left (parent child))
;;; Make CHILD the right child of PARENT.
(defgeneric link-right (parent child))
;;; Remove CHILD as the left child of PARENT.
(defgeneric unlink-left (parent child))
;;; Remove CHILD as the right child ... |
Fix system names (slash instead of dot) | ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
(eval-when (:compile-toplevel :load-toplevel :execute)
(asdf:oos 'asdf:load-op :cffi-grovel))
;;; Fix ecl long-long support
#+(and ecl (or cffi-features:no-long-long cffi-sys::no-long-long))
(defmethod perform :after ((o load-op) (c (eql (find... | ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
(eval-when (:compile-toplevel :load-toplevel :execute)
(asdf:oos 'asdf:load-op :cffi-grovel))
;;; Fix ecl long-long support
#+(and ecl (or cffi-features:no-long-long cffi-sys::no-long-long))
(defmethod perform :after ((o load-op) (c (eql (find... |
Update package name to reflect move from phase 2 to phase 1. | (cl:in-package #:sicl-boot-phase2)
(cl:defclass bridge-generic-function
(#+sbcl sb-pcl:funcallable-standard-object
sicl-boot-phase1:standard-generic-function)
()
(:metaclass #+sbcl sb-pcl:funcallable-standard-class))
(cl:defmethod cl:print-object ((object bridge-generic-function) stream)
(print-unreada... | (cl:in-package #:sicl-boot-phase1)
(cl:defclass bridge-generic-function
(#+sbcl sb-pcl:funcallable-standard-object
sicl-boot-phase1:standard-generic-function)
()
(:metaclass #+sbcl sb-pcl:funcallable-standard-class))
(cl:defmethod cl:print-object ((object bridge-generic-function) stream)
(print-unreada... |
Remove the call of NOT-FOUND function from router | (in-package #:eloquent.mvc.middleware)
(defun make-static-file (path-info prefix root)
(let ((path (remove-prefix prefix path-info)))
(merge-pathnames path
(merge-pathnames "static/" root))))
(defun get-prefix (config)
(eloquent.mvc.config:get config "static-file" "prefix"))
(defun remov... | (in-package #:eloquent.mvc.middleware)
(defun make-static-file (path-info prefix root)
(let ((path (remove-prefix prefix path-info)))
(merge-pathnames path
(merge-pathnames "static/" root))))
(defun get-prefix (config)
(eloquent.mvc.config:get config "static-file" "prefix"))
(defun remov... |
Change singleton agent "lock" port number to avoid conflict with some Windows service. | ;;;; -*- Mode: LISP; Syntax: COMMON-LISP; indent-tabs-mode: nil; coding: utf-8; show-trailing-whitespace: t -*-
;;;; Copyright (C) 2011 Anton Vodonosov (avodonosov@yandex.ru)
;;;; See LICENSE for details.
;;;; Preventing more than one agent to run in parallel.
;;;; This is important, becuase the agents will
;;;;... | ;;;; -*- Mode: LISP; Syntax: COMMON-LISP; indent-tabs-mode: nil; coding: utf-8; show-trailing-whitespace: t -*-
;;;; Copyright (C) 2011 Anton Vodonosov (avodonosov@yandex.ru)
;;;; See LICENSE for details.
;;;; Preventing more than one agent to run in parallel.
;;;; This is important, becuase the agents will
;;;;... |
Add copyright dates and license statement. | (cl:in-package #:sicl-clos)
;;; FIXME: I can not remember why I decided not to use initargs for
;;; the slots here, and instead calling explicit writers in :AFTER
;;; methods on INITIALIZE-INSTANCE and REINITIALIZE-INSTANCE.
(defclass generic-function (metaobject funcallable-standard-object)
(;; While there is a fu... | ;;;; Copyright (c) 2013 - 2015
;;;;
;;;; Robert Strandh (robert.strandh@gmail.com)
;;;;
;;;; All rights reserved.
;;;;
;;;; Redistribution and use in source and binary forms, with or
;;;; without modification, are permitted provided that the following
;;;; conditions are met:
;;;;
;;;; 1. Redistributions of source ... |
Add the usual test boilerplate to the system file | (defpackage #:dynamic-classes-system (:use #:common-lisp #:asdf))
(in-package #:dynamic-classes-system)
(defsystem dynamic-classes
:author "Gary Warren King <gwking@metabang.com>"
:version "1.0.1"
:maintainer "Gary Warren King <gwking@metabang.com>"
:licence "MIT Style license"
:components ((:module
"dev"... | (defpackage #:dynamic-classes-system (:use #:common-lisp #:asdf))
(in-package #:dynamic-classes-system)
(defsystem dynamic-classes
:author "Gary Warren King <gwking@metabang.com>"
:version "1.0.1"
:maintainer "Gary Warren King <gwking@metabang.com>"
:licence "MIT Style license"
:components ((:module
"dev"... |
Use explicit package prefix for IN-PACKAGE. | (in-package :sicl-arithmetic)
(defun + (&rest args)
(cond ((null args) 0)
;; FIXME: check that we have a number
((null (cdr args)) (car args))
(t (apply #'+ (binary-+ (car args) (cadr args)) (cddr args)))))
(defun - (x &rest args)
(cond ((null args) (negate x))
((null (cdr args)) (binary-- x (car args)))
(t... | (cl:in-package :sicl-arithmetic)
(defun + (&rest args)
(cond ((null args) 0)
;; FIXME: check that we have a number
((null (cdr args)) (car args))
(t (apply #'+ (binary-+ (car args) (cadr args)) (cddr args)))))
(defun - (x &rest args)
(cond ((null args) (negate x))
((null (cdr args)) (binary-- x (car args)))
... |
Add condition reporter for new condition. | (cl:in-package #:sicl-data-and-control-flow)
(defmethod cleavir-i18n:report-condition
((condition odd-number-of-arguments-to-setf)
stream
(langauge cleavir-i18n:english))
(format stream
"An odd number of arguments was given to SETF~@
in the following form:~@
~s"
(for... | (cl:in-package #:sicl-data-and-control-flow)
(defmethod cleavir-i18n:report-condition
((condition odd-number-of-arguments-to-setf)
stream
(langauge cleavir-i18n:english))
(format stream
"An odd number of arguments was given to SETF~@
in the following form:~@
~s"
(for... |
Change namespace of custom vocabularies music and bravoer | (in-package :mu-cl-resources)
(add-prefix "nie" "http://www.semanticdesktop.org/ontologies/2007/01/19/nie/#")
(add-prefix "nco" "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#")
(add-prefix "nfo" "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#")
(add-prefix "dcterms" "http://purl.org/dc/terms/")
... | (in-package :mu-cl-resources)
(add-prefix "nie" "http://www.semanticdesktop.org/ontologies/2007/01/19/nie/#")
(add-prefix "nco" "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#")
(add-prefix "nfo" "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#")
(add-prefix "dcterms" "http://purl.org/dc/terms/")
... |
Call function LEAVE before returning or entering right subtree. | (cl:in-package #:clump-binary-tree)
(defgeneric iterative-traversal (tree enter leave))
(defmethod iterative-traversal ((tree node-with-parent) enter leave)
(let ((current-node tree))
(loop do (if (or (not (funcall enter current-node))
(and (null (left current-node))
(null (right current-node))))
... | (cl:in-package #:clump-binary-tree)
(defgeneric iterative-traversal (tree enter leave))
(defmethod iterative-traversal ((tree node-with-parent) enter leave)
(let ((current-node tree))
(loop do (if (or (not (funcall enter current-node))
(and (null (left current-node))
(null (right current-node))))
... |
Add license attribute to asdf file. | (in-package :asdf-user)
(defsystem "bytecurry.asdf-ext"
:class :package-inferred-system
:author "Thayne McCombs"
:maintainer "Thayne McCombs"
:mailto "bytecurry.software@gmail.com"
:defsystem-depends-on (:asdf-package-system)
:depends-on (:bytecurry.asdf-ext/doc-op :bytecurry.asdf-ext/atdoc))
| (in-package :asdf-user)
(defsystem "bytecurry.asdf-ext"
:class :package-inferred-system
:author "Thayne McCombs"
:maintainer "Thayne McCombs"
:mailto "bytecurry.software@gmail.com"
:license "MIT"
:defsystem-depends-on (:asdf-package-system)
:depends-on (:bytecurry.asdf-ext/doc-op :bytecurry.asdf-ext/atdo... |
Add comment about possibly useless *ENVIRONMENT-MACROS*. | ; tré – Copyright (c) 2011–2013,2015 Sven Michael Klose <pixel@copei.de>
(define-expander 'standard-macros)
(set-expander-macros 'standard-macros *macros*)
(= *standard-macro-expander* (expander-get 'standard-macros))
(defun %%macro? (x)
(expander-has-macro? 'standard-macros x.))
(defun %%macrocall (x)
(funcall ... | ; tré – Copyright (c) 2011–2013,2015 Sven Michael Klose <pixel@copei.de>
(define-expander 'standard-macros)
(set-expander-macros 'standard-macros *macros*)
(= *standard-macro-expander* (expander-get 'standard-macros))
(defun %%macro? (x)
(expander-has-macro? 'standard-macros x.))
(defun %%macrocall (x)
(funcall ... |
Add grep to asd file.' | (in-package :cl-user)
(defpackage :med-asd
(:use :cl :asdf))
(in-package :med-asd)
(defsystem :med
:version "0.1"
:description "med - Mezzano EDitor"
:serial t
:components ((:file "package")
(:file "line")
(:file "mark")
(:file "editor")
(:file "b... | (in-package :cl-user)
(defpackage :med-asd
(:use :cl :asdf))
(in-package :med-asd)
(defsystem :med
:version "0.1"
:description "med - Mezzano EDitor"
:serial t
:components ((:file "package")
(:file "line")
(:file "mark")
(:file "editor")
(:file "b... |
Define new class OPTIONAL-PARAMETER using generalized class as superclass. | (cl:in-package #:cleavir-cst)
(defclass optional-or-keyword--parameter ()
(;; This slot contains the CST for the obligatory variable of the
;; parameter.
(%variable-cst :initarg :variable-cst :reader variable-cst)
;; This slot contains a CST for the INIT-FORM of the parameter. If
;; no INIT-FORM was sup... | (cl:in-package #:cleavir-cst)
(defclass optional-or-keyword--parameter ()
(;; This slot contains the CST for the obligatory variable of the
;; parameter.
(%variable-cst :initarg :variable-cst :reader variable-cst)
;; This slot contains a CST for the INIT-FORM of the parameter. If
;; no INIT-FORM was sup... |
Define ASDF system in package ASDF-USER. | (in-package #:cl-user)
(asdf:defsystem :sicl-sequences-small-test
:depends-on (:lisp-unit :sicl-sequences-small)
:components
((:file "test" :depends-on ())))
| (cl:in-package #:asdf-user)
(defsystem :sicl-sequences-small-test
:depends-on (:lisp-unit :sicl-sequences-small)
:components
((:file "test" :depends-on ())))
|
Include support code for ENSURE-CLASS-USING-CLASS. | (cl:in-package #:asdf-user)
(defsystem :sicl-clos-support
:depends-on (:sicl-clos-package
:sicl-global-environment)
:serial t
:components
((:file "ensure-generic-function-using-class-support")
(:file "make-method-lambda-support")
(:file "make-method-lambda-defgenerics")
(:file "make-method-lam... | (cl:in-package #:asdf-user)
(defsystem :sicl-clos-support
:depends-on (:sicl-clos-package
:sicl-global-environment)
:serial t
:components
((:file "ensure-generic-function-using-class-support")
(:file "make-method-lambda-support")
(:file "make-method-lambda-defgenerics")
(:file "make-method-lam... |
Add initargs for :DESCRIPTION, :AUTHOR, and :LICENSE. | (cl:in-package #:asdf-user)
(defsystem clump
:depends-on (:clump-binary-tree))
| (cl:in-package #:asdf-user)
(defsystem clump
:description "Library for operations on different kinds of trees"
:author "Robert Strandh <robert.strandh@gmail.com>"
:license "FreeBSD, see file LICENSE.text"
:depends-on (:clump-binary-tree))
|
Add local-time to the list of deps | (defpackage #:info.isoraqathedh.umpns.asdf
(:use #:cl #:asdf))
(in-package #:info.isoraqathedh.umpns.asdf)
(defsystem umpns
:name "UMPNS-based Minor Planet Namer"
:version "0.1"
:license "MIT"
:components ((:file "unified-minor-planet-naming-system"))
:depends-on (:cl-ppcre :sqlite :iterate))
| (defpackage #:info.isoraqathedh.umpns.asdf
(:use #:cl #:asdf))
(in-package #:info.isoraqathedh.umpns.asdf)
(defsystem umpns
:name "UMPNS-based Minor Planet Namer"
:version "0.1"
:license "MIT"
:components ((:file "unified-minor-planet-naming-system"))
:depends-on (:cl-ppcre :sqlite :iterate :local-time))
|
Adjust output of test case to new behavior. | (test-directories ".")
(test
("Bug 0099 : Extra 'let' in generated proof obligation"
:show "MinusOb#MinusProof"
:output ";;; Elaborating proof-term at $TESTDIR/MinusOb#MinusProof
;;; Elaborating obligator at $TESTDIR/MinusOb#ONat
;; ensure-directories-exist: creating $TESTDIR/Snark/MinusOb/MinusProof.log
;; ... | (test-directories ".")
(test
("Bug 0099 : Extra 'let' in generated proof obligation"
:show "MinusOb#MinusProof"
:output '(
";;; Elaborating proof-term at $TESTDIR/MinusOb#MinusProof"
";;; Elaborating obligator at $TESTDIR/MinusOb#ONat"
" Expanded spec file: $TESTDIR/Snark/MinusOb/MinusProof... |
Use function GLOBAL-ENVIRONMENT rather than obsolete special variable. | (cl:in-package #:sicl-data-and-control-flow)
(defun fdefinition (function-name)
(sicl-global-environment:fdefinition
function-name
sicl-global-environment:*global-environment*))
| (cl:in-package #:sicl-data-and-control-flow)
(defun fdefinition (function-name)
(sicl-global-environment:fdefinition
function-name
(load-time-value
(sicl-global-environment:global-environment))))
|
Fix test to reflect change to scheme style reduce. | (describe reduce-with-lambda
(== (reduce (lambda (acc item) 0 (+ acc item)) 0 '(1 2 3)) 6))
(describe reduce-with-primitive
(== (reduce + 0 '(1 2 3)) 6))
(describe reduce-building-a-list
(== (reduce (lambda (l i) (cons i l)) '() '(1 2 3 4)) '(4 3 2 1))) | (describe reduce-with-lambda
(== (reduce (lambda (acc item) 0 (+ acc item)) 0 '(1 2 3)) 6))
(describe reduce-with-primitive
(== (reduce + 0 '(1 2 3)) 6))
(describe reduce-building-a-list
(== (reduce (lambda (l i) (cons i l)) '() '(1 2 3 4)) '(4 3 2 . 1))
(== (reduce list '() '(1 2 ... |
Define abstractions for access to target GF database. | (cl:in-package #:sicl-clos)
(defparameter *target-generic-functions* '())
| (cl:in-package #:sicl-clos)
(defparameter *target-generic-functions* '())
(defun add-target-generic-function (name function)
(pushnew (cons name function) *target-generic-functions*
:key #'car :test #'equal))
(defun find-target-generic-function (name)
(let ((entry (assoc name *target-generic-functions* :test... |
Add comment explaining the purpose of the slot OPERATION in class PORT. | (cl:in-package #:cleavir-dataflow-analysis)
(defclass port ()
((%operation :initarg :operation :reader operation)
(%datum :initarg :datum :reader datum)))
(defclass input (port)
((%outputs :initform '() :initarg outputs :accessor outputs)))
(defclass output (port)
((%inputs :initform '() :initarg inputs :ac... | (cl:in-package #:cleavir-dataflow-analysis)
(defclass port ()
(;; The operation to which this port belongs.
(%operation :initarg :operation :reader operation)
(%datum :initarg :datum :reader datum)))
(defclass input (port)
((%outputs :initform '() :initarg outputs :accessor outputs)))
(defclass output (por... |
Fix openmcl's definition of lexical-variables to deal with ccl::definition-environment | ;;;; -*- lisp -*-
(in-package :it.bese.arnesi)
;;;; * Portable lexical environment access
;;;; ** OpenMCL
#+openmcl
(defun environment-p (environment)
(subtypep (class-of environment) 'ccl::lexical-environment))
#+openmcl
(defun lexical-variables (environment)
(loop
for env = environment then (ccl::lexenv... | ;;;; -*- lisp -*-
(in-package :it.bese.arnesi)
;;;; * Portable lexical environment access
;;;; ** OpenMCL
#+openmcl
(defun environment-p (environment)
(subtypep (class-of environment) 'ccl::lexical-environment))
#+openmcl
(defun lexical-variables (environment)
(loop
for env = environment
then (c... |
Update cl-postgres integration system file | (defsystem :cl-postgres+local-time
:depends-on (:cl-postgres :local-time)
:components ((:module "src"
:components ((:module "integration"
:components ((:file "cl-postgres")))))))
| (defsystem #:cl-postgres+local-time
:name "cl-postgres+local-time"
:version "1.0.5"
:author "Daniel Lowe <dlowe@dlowe.net>"
:description "Integration between cl-postgres and local-time"
:depends-on (:cl-postgres :local-time)
:components ((:module "src"
:components ((:module "integration"
... |
Load a file containing the definition of the class CLASS. | (cl:in-package #:sicl-boot)
(defun create-bridge-classes (boot)
(let ((c (c1 boot))
(r (r2 boot)))
(ld "../CLOS/t-defclass.lisp" c r)
(ld "../CLOS/standard-object-defclass.lisp" c r)
(ld "../CLOS/metaobject-defclass.lisp" c r)
(ld "../CLOS/specializer-defclass.lisp" c r)))
| (cl:in-package #:sicl-boot)
(defun create-bridge-classes (boot)
(let ((c (c1 boot))
(r (r2 boot)))
(ld "../CLOS/t-defclass.lisp" c r)
(ld "../CLOS/standard-object-defclass.lisp" c r)
(ld "../CLOS/metaobject-defclass.lisp" c r)
(ld "../CLOS/specializer-defclass.lisp" c r)
(ld "../CLOS/class-defcl... |
Set fdefinition of SICL-CLOS:INITIALIZE-INSTANCE to CL:INITIALIZE-INTANCE. | (cl:in-package #:sicl-clos)
(defmethod initialize-instance (object &rest keys &key)
(declare (ignore object keys))
nil)
(cl:defmethod cl:initialize-instance :after
((metaobject metaobject) &rest keys &key &allow-other-keys)
(apply #'initialize-instance metaobject keys))
| (cl:in-package #:sicl-clos)
(setf (fdefinition 'initialize-instance)
(fdefinition 'cl:initialize-instance))
|
Call FINISH-OUTPUT after writing trace message. | (cl:in-package #:sicl-extrinsic-environment)
(defun load-file (filename environment)
(format *trace-output* "Loading file ~a~%" filename)
(load-source-with-environments
(asdf:system-relative-pathname :sicl-extrinsic-environment filename)
environment
environment))
| (cl:in-package #:sicl-extrinsic-environment)
(defun load-file (filename environment)
(format *trace-output* "Loading file ~a~%" filename)
(finish-output *trace-output*)
(load-source-with-environments
(asdf:system-relative-pathname :sicl-extrinsic-environment filename)
environment
environment))
|
Remove call to truename to fix CNAME generation. | (eval-when (:compile-toplevel :load-toplevel)
(ql:quickload 'puri))
(defpackage :coleslaw-gh-pages
(:use :cl)
(:import-from :puri #:parse-uri #:uri-host)
(:import-from :coleslaw #:*config*
#:deploy
#:deploy-dir
#:domain
... | (eval-when (:compile-toplevel :load-toplevel)
(ql:quickload 'puri))
(defpackage :coleslaw-gh-pages
(:use :cl)
(:import-from :puri #:parse-uri #:uri-host)
(:import-from :coleslaw #:*config*
#:deploy
#:deploy-dir
#:domain
... |
Remove old unused function test-gird-reporting::list-failures | ;;; -*- Mode: LISP; Syntax: COMMON-LISP; indent-tabs-mode: nil; coding: utf-8; -*-
;;; Copyright (C) 2011 Anton Vodonosov (avodonosov@yandex.ru)
;;; See LICENSE for details.
(asdf:defsystem #:test-grid-reporting
:version "0.1.0"
:serial t
:depends-on (#:test-grid-data #:test-grid-utils #:test-grid-agent ... | ;;; -*- Mode: LISP; Syntax: COMMON-LISP; indent-tabs-mode: nil; coding: utf-8; -*-
;;; Copyright (C) 2011 Anton Vodonosov (avodonosov@yandex.ru)
;;; See LICENSE for details.
(asdf:defsystem #:test-grid-reporting
:version "0.1.0"
:serial t
:depends-on (#:test-grid-data #:test-grid-utils #:test-grid-agent ... |
Correct typo in class defn | ;; math-system-utils.lisp - misc. utility forms
(in-package #:math)
(define-condition entity-condition ()
((name
:initarg :name
:reader entity-condition-name)))
(define-condition entity-not-found (error entity-condition)
())
(define-condition redefinition-condition (style-warning)
((previous-object
... | ;; math-system-utils.lisp - misc. utility forms
(in-package #:math)
(define-condition entity-condition ()
((name
:initarg :name
:reader entity-condition-name)))
(define-condition entity-not-found (error entity-condition)
())
(define-condition redefinition-condition (style-warning)
((previous-object
... |
Add include path for OSX | ;; Declaration of package
;; Liam Healy 2009-02-22 09:55:45EST pkgdcl.lisp
;; Time-stamp: <2009-05-12 15:27:21EDT init.lisp>
(in-package :common-lisp-user)
(defpackage :foreign-structures-by-value
(:nicknames #:fsbv)
(:use #:common-lisp))
(cffi:load-foreign-library
#+darwin "libffi.dylib"
#+(and (not darwin) u... | ;; Declaration of package
;; Liam Healy 2009-02-22 09:55:45EST pkgdcl.lisp
;; Time-stamp: <2009-08-22 16:20:00EDT init.lisp>
(in-package :common-lisp-user)
(defpackage :foreign-structures-by-value
(:nicknames #:fsbv)
(:use #:common-lisp))
(cffi:load-foreign-library
#+darwin "libffi.dylib"
#+(and (not darwin) u... |
Define generic function 3-NODE-P with two methods. | (cl:in-package #:clump-2-3-tree)
(defclass tree ()
((%contents :initform nil :accessor contents)
(%leaf-class :initarg :leaf-class :reader leaf-class)
(%2-node-class :initarg :2-node-class :reader 2-node-class)
(%3-node-class :initarg :3-node-class :reader 3-node-class)))
(defclass node ()
((%parent :ini... | (cl:in-package #:clump-2-3-tree)
(defclass tree ()
((%contents :initform nil :accessor contents)
(%leaf-class :initarg :leaf-class :reader leaf-class)
(%2-node-class :initarg :2-node-class :reader 2-node-class)
(%3-node-class :initarg :3-node-class :reader 3-node-class)))
(defclass node ()
((%parent :ini... |
Fix typo in a docstring. | (defpackage #:eos-api
(:use :cl #:api-dsl)
(:export #:run-test-suites
#:failed-tests))
(in-package #:eos-api)
(proclfun run-test-suites (&rest (test-suite-spec symbol)) t
"Runs one or more Eos test suites specified by arguments and returns
an opaque result object combining all the results. ... | (defpackage #:eos-api
(:use :cl #:api-dsl)
(:export #:run-test-suites
#:failed-tests))
(in-package #:eos-api)
(proclfun run-test-suites (&rest (test-suite-spec symbol)) t
"Runs one or more Eos test suites specified by arguments and returns
an opaque result object combining all the results. ... |
Add comment explaining what ITERATIVE-TRAVERSAL does. | (cl:in-package #:clump-binary-tree)
(defgeneric iterative-traversal (tree pre in post))
(defmethod iterative-traversal ((tree node-with-parent) pre in post)
(let ((current-node tree))
(tagbody
pre
(if (funcall pre current-node)
(let ((left (left current-node)))
(if (null left)
(go in)
... | (cl:in-package #:clump-binary-tree)
;;;; Depth-first iterative traversal.
;;;;
;;;; PRE, IN, and POST are functions of a single variable. Each of
;;;; these functions is called with a NODE as its argument.
;;;;
;;;; Before a node is visited, PRE is called with that node as an
;;;; argument. If PRE returns true, this... |
Add English documentation for function (SETF RIGHT). | (cl:in-package #:clump-binary-tree)
(setf (documentation 'left 'function)
(format nil "Given a binary tree, return the left child of that tree.~@
If an object other than a binary tree is given,~@
then an error of type INVALID-BINARY-TREE is signaled."))
(setf (documentation... | (cl:in-package #:clump-binary-tree)
(setf (documentation 'left 'function)
(format nil "Given a binary tree, return the left child of that tree.~@
If an object other than a binary tree is given,~@
then an error of type INVALID-BINARY-TREE is signaled."))
(setf (documentation... |
TEST keyword accepted as first argument. | ;;;; TRE environment
;;;; Copyright (c) 2005-2008 Sven Klose <pixel@copei.de>
(defmacro when (predicate &rest expr)
`(and ,predicate
,(if (cdr expr)
`(progn ,@expr)
(car expr))))
(defmacro unless (predicate &rest expr)
`(when (not ,predicate) ,@expr))
(defun group2 (x)
(if x
(... | ;;;; TRE environment
;;;; Copyright (c) 2005-2008,2011 Sven Klose <pixel@copei.de>
(defmacro when (predicate &rest expr)
`(and ,predicate
,(if (cdr expr)
`(progn ,@expr)
(car expr))))
(defmacro unless (predicate &rest expr)
`(when (not ,predicate) ,@expr))
(defun group2 (x)
(if x
... |
Use package ASDF-USER to define system. | (cl:in-package #:common-lisp-user)
(asdf:defsystem :cleavir-hir
:depends-on (:cleavir-ir)
:serial t
:components
((:file "data")
(:file "box-unbox-mixins")
(:file "side-effect-mixins")
(:file "general-purpose-instructions")
(:file "fixnum-related-instructions")
(:file "integer-related-instruction... | (cl:in-package #:asdf-user)
(defsystem :cleavir-hir
:depends-on (:cleavir-ir)
:serial t
:components
((:file "data")
(:file "box-unbox-mixins")
(:file "side-effect-mixins")
(:file "general-purpose-instructions")
(:file "fixnum-related-instructions")
(:file "integer-related-instructions")
(:fil... |
Use Cleavir def of x86-64. | (cl:in-package #:sicl-extrinsic-file-compiler)
(defparameter *sicl* (make-instance 'sicl-target-sicl:sicl))
(defparameter *gnu-linux* (make-instance 'sicl-os-gnu-linux:gnu-linux))
(defparameter *x86-64* (make-instance 'sicl-x86-64:x86-64))
(defun ast-from-stream (stream environment)
(cleavir-ast:make-progn-ast
... | (cl:in-package #:sicl-extrinsic-file-compiler)
(defparameter *sicl* (make-instance 'sicl-target-sicl:sicl))
(defparameter *gnu-linux* (make-instance 'sicl-os-gnu-linux:gnu-linux))
(defparameter *x86-64* (make-instance 'cleavir-processor-x86-64:x86-64))
(defun ast-from-stream (stream environment)
(cleavir-ast:make... |
Add description to .asd file. | ;;
;; Copyright (c) 2005-2010, Peter Seibel. All rights reserved.
;;
(defsystem com.gigamonkeys.parser
:author "Peter Seibel <peter@gigamonkeys.com>"
:components
((:file "packages")
(:file "parser" :depends-on ("packages")))
:depends-on (:com.gigamonkeys.macro-utilities
:com.gigamonkeys.utilities))... | ;;
;; Copyright (c) 2005-2011, Peter Seibel. All rights reserved.
;;
(defsystem com.gigamonkeys.parser
:author "Peter Seibel <peter@gigamonkeys.com>"
:description "Parser generator, loosely based on Henry Baker's META paper."
:components
((:file "packages")
(:file "parser" :depends-on ("packages")))
:depe... |
Use explicit package prefix for IN-PACKAGE. | (in-package #:sicl-data-and-control-flow)
(defmacro setf (&whole form &environment env place new-value-form &rest more-pairs)
(cond ((null more-pairs)
(multiple-value-bind (variables
values
store-variables
writer-form
reader-form)
(sicl-env:get-setf-expansion place env... | (cl:in-package #:sicl-data-and-control-flow)
(defmacro setf (&whole form &environment env place new-value-form &rest more-pairs)
(cond ((null more-pairs)
(multiple-value-bind (variables
values
store-variables
writer-form
reader-form)
(sicl-env:get-setf-expansion place ... |
Fix symbols in static pages plugin some more. | (defpackage :coleslaw-static-pages
(:use :cl)
(:export #:enable)
(:import-from :coleslaw #:*config*
#:content
#:content-text
#:page-url
#:find-all
#:render
#:... | (defpackage :coleslaw-static-pages
(:use :cl)
(:export #:enable)
(:import-from :coleslaw #:*config*
#:content
#:find-all
#:render
#:publish
#:theme-fn
#:rende... |
Add option to reset error flag | (in-package :clox)
(let ((had-error nil))
(-> had-error () boolean)
(defun had-error ()
had-error)
(-> raise-error (integer string) null)
(defun raise-error (line message)
(report line "" message))
(-> report (integer string string) null)
(defun report (line location message)
(format *error-... | (in-package :clox)
(let ((had-error nil))
(-> had-error () boolean)
(defun had-error ()
had-error)
(-> reset-error-flag () null)
(defun reset-error-flag ()
(setf had-error nil)
nil)
(-> raise-error (integer string) null)
(defun raise-error (line message)
(report line "" message))
(-> ... |
Add lat, lon, and ele exports. | ;;;; package.lisp
(defpackage #:gpxtools
(:use #:cl)
(:export #:read-gpx
#:distance
#:elevation-gain
#:elevation-loss
#:distance-between
#:elevation-diff
#:meters-to-feet
#:meters-to-miles
#:get-summary
#:summarize
... | ;;;; package.lisp
(defpackage #:gpxtools
(:use #:cl)
(:export #:read-gpx
#:distance
#:elevation-gain
#:elevation-loss
#:distance-between
#:elevation-diff
#:meters-to-feet
#:meters-to-miles
#:get-summary
#:summarize
... |
Make the wsdeque test less expensive. | ;;;; © 2016-2020 Marco Heisig - license: GNU AGPLv3 -*- coding: utf-8 -*-
(in-package #:petalisp.test-suite)
(check-package '#:petalisp.utilities)
(define-test wsdeque-test
(loop repeat 100 do
(let* ((n-threads (petalisp.utilities:number-of-cpus))
(iterations (random 50000))
(wsde... | ;;;; © 2016-2020 Marco Heisig - license: GNU AGPLv3 -*- coding: utf-8 -*-
(in-package #:petalisp.test-suite)
(check-package '#:petalisp.utilities)
(define-test wsdeque-test
(loop repeat 50 do
(let* ((n-threads (petalisp.utilities:number-of-cpus))
(iterations (random 20000))
(wsdeq... |
Convert CONST to DEFCONSTANT, not to DEFVAR. | (%defmacro defvar (name &optional (init '%%%no-init))
(print-definition `(var ,name))
(? (not (symbol? name))
(%error "Symbol expected as variable name."))
`(%defvar ,name ,(? (eq '%%%no-init init)
`',init
init)))
(%defmacro var (name &optional (init nil))
`(def... | (%defmacro defvar (name &optional (init '%%%no-init))
(print-definition `(var ,name))
(? (not (symbol? name))
(%error "Symbol expected as variable name."))
`(%defvar ,name ,(? (eq '%%%no-init init)
`',init
init)))
(%defmacro var (name &optional (init nil))
`(def... |
Include component conditions.lisp in system definition. | (cl:in-package #:asdf-user)
(defsystem :sicl-sequence-support
:serial t
:components
((:file "packages")
(:file "utilities")
(:file "find")
(:file "position")))
| (cl:in-package #:asdf-user)
(defsystem :sicl-sequence-support
:serial t
:components
((:file "packages")
(:file "utilities")
(:file "conditions")
(:file "find")
(:file "position")))
|
Make sure the computation terminates even though the AST has cycles. | (cl:in-package #:cleavir-ast-transformations)
(defun find-load-time-value-asts (ast)
(if (typep ast 'cleavir-ast:load-time-value-ast)
(list ast)
(let ((children (cleavir-ast:children ast)))
(reduce #'append (mapcar #'find-load-time-value-asts children)
:from-end t))))
(defun hoist-load-time-value (as... | (cl:in-package #:cleavir-ast-transformations)
(defun find-load-time-value-asts (ast)
(let ((table (make-hash-table :test #'eq)))
(labels ((traverse (ast)
(unless (gethash ast table)
(setf (gethash ast table) t)
(if (typep ast 'cleavir-ast:load-time-value-ast)
(list ast)
(let ((childre... |
Put the first URL into a named parameter | (in-package :lispkit)
(defun load-ui-from-file (path)
(if (probe-file path)
(let ((builder (gtk:gtk-builder-new)))
(gtk:gtk-builder-add-from-file builder (namestring path))
builder)
(error (format nil "non existent path: ~s" path))))
(defun main (&rest args)
(declare (ignore args))
... | (in-package :lispkit)
(defparameter *default-page*
"http://www.github.com/AeroNotix/lispkit")
(defun load-ui-from-file (path)
(if (probe-file path)
(let ((builder (gtk:gtk-builder-new)))
(gtk:gtk-builder-add-from-file builder (namestring path))
builder)
(error (format nil "non existen... |
Switch development mode back on. | (%defvar *development?* nil)
(%defvar *assert?* t)
(%defvar *print-definitions?* t)
;; Optional environment sections.
(%defvar *tre-has-math* t) ; Mathematical functions.
(%defvar *tre-has-class* t) ; STRUCT CLASS.
;; Transpiler
;;; Targets to include in environment:
;;; :cl Common Lisp (sbcl)... | (%defvar *development?* t)
(%defvar *assert?* t)
(%defvar *print-definitions?* t)
;; Optional environment sections.
(%defvar *tre-has-math* t) ; Mathematical functions.
(%defvar *tre-has-class* t) ; STRUCT CLASS.
;; Transpiler
;;; Targets to include in environment:
;;; :cl Common Lisp (sbcl)
;... |
Add missing argument for setter. | (defmacro define-get-alias (alias real &key (class nil))
`(defmethod ,class ,($ 'get- alias) ()
,real))
(defmacro define-set-alias (alias real &key (class nil))
`(defmethod ,class ,($ 'set- alias) ()
(= ,real x)))
(defmacro define-getset-alias (alias real &key (class nil))
`{(define-get-alias ,alias... | (defmacro define-get-alias (alias real &key (class nil))
`(defmethod ,class ,($ 'get- alias) ()
,real))
(defmacro define-set-alias (alias real &key (class nil))
`(defmethod ,class ,($ 'set- alias) (x)
(= ,real x)))
(defmacro define-getset-alias (alias real &key (class nil))
`{(define-get-alias ,alia... |
Use native String instead of FORMAT. | ;;;;; tré – Copyright (c) 2008–2014 Sven Michael Klose <pixel@copei.de>
(declare-cps-exception string %string? string? string== string-concat string-upcase string-downcase string-subseq)
(dont-obfuscate push join char-code-at to-string to-upper-case to-lower-case substr length)
(js-type-predicate %string? "string")
... | ;;;;; tré – Copyright (c) 2008–2014 Sven Michael Klose <pixel@copei.de>
(declare-cps-exception string %string? string? string== string-concat string-upcase string-downcase string-subseq)
(dont-obfuscate push join char-code-at to-string to-upper-case to-lower-case substr length)
(js-type-predicate %string? "string")
... |
Remove class definition. Now, Binary-tree contains definition of node with parent. | (cl:in-package #:clump-splay-tree)
(defclass node (clump-binary-tree:node)
((%parent :initarg :parent :initform nil :accessor parent)))
(defgeneric splay-step (node))
(defgeneric splay (node))
| (cl:in-package #:clump-splay-tree)
(defgeneric splay-step (node))
(defgeneric splay (node))
|
Replace offline slack.net with Wikipedia. | ;;;; SPDX-FileCopyrightText: Atlas Engineer LLC
;;;; SPDX-License-Identifier: BSD-3-Clause
(in-package :cl-user)
(prove:plan nil)
(prove:subtest "Simple HTTP/HTTPS downloads"
(let ((uris '("https://abcl.org"
"http://slack.net"
"https://duckduckgo.com"
"https://atlas.... | ;;;; SPDX-FileCopyrightText: Atlas Engineer LLC
;;;; SPDX-License-Identifier: BSD-3-Clause
(in-package :cl-user)
(prove:plan nil)
(prove:subtest "Simple HTTP/HTTPS downloads"
(let ((uris '("https://abcl.org"
"http://en.wikipedia.org/wiki/Main_Page"
"https://duckduckgo.com"
... |
Load file containing definition of MULTIPLE-VALUE-BIND. | (cl:in-package #:sicl-extrinsic-environment)
(defun fill-environment (environment)
(import-from-host-common-lisp environment)
(import-from-sicl-global-environment environment)
(import-loop-support environment)
(define-backquote-macros environment)
(define-defmacro environment)
(define-in-package environmen... | (cl:in-package #:sicl-extrinsic-environment)
(defun fill-environment (environment)
(import-from-host-common-lisp environment)
(import-from-sicl-global-environment environment)
(import-loop-support environment)
(define-backquote-macros environment)
(define-defmacro environment)
(define-in-package environmen... |
Improve the way that brlapi.lisp is found. (ml) | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; libbrlapi - A library providing access to braille terminals for applications.
;
; Copyright (C) 2006-2018 by Mario Lang <mlang@delysid.org>
;
; libbrlapi comes with ABSOLUTELY NO WARRANTY.
;
; This is free software, placed under the terms... | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; libbrlapi - A library providing access to braille terminals for applications.
;
; Copyright (C) 2006-2018 by Mario Lang <mlang@delysid.org>
;
; libbrlapi comes with ABSOLUTELY NO WARRANTY.
;
; This is free software, placed under the terms... |
Add needed dependencies to .asd. | ;;
;; Copyright (c) 2010, Peter Seibel. All rights reserved.
;;
(defsystem gigamonkey-distcompiler
:components
((:file "packages")
(:file "tarhash" :depends-on ("packages"))
(:file "distcompiler" :depends-on ("packages" "tarhash")))
:depends-on (:ironclad)) | ;;
;; Copyright (c) 2010, Peter Seibel. All rights reserved.
;;
(defsystem gigamonkey-distcompiler
:components
((:file "packages")
(:file "tarhash" :depends-on ("packages"))
(:file "distcompiler" :depends-on ("packages" "tarhash")))
:depends-on (:ironclad
:com.gigamonkeys.pathnames
... |
Add comment explaining what the function does. | (cl:in-package #:cleavir-boolean-elimination)
(defun find-boolean-tests (initial-instruction)
(let ((result '()))
(cleavir-ir:map-instructions-arbitrary-order
(lambda (instruction)
(when (typep instruction 'cleavir-ir:eq-instruction)
(destructuring-bind (i1 i2) (cleavir-ir:inputs instruction)
(... | (cl:in-package #:cleavir-boolean-elimination)
;;; We search for EQ-INSTRUCTIONs where one of the inputs is a
;;; LOAD-TIME-VALUE-INPUT with a constant form of NIL, meaning that
;;; the instruction tests its other input as a Boolean. We return a
;;; list of such instructions in the program.
(defun find-boolean-tests (... |
Remove DATE-TO-TIMESTAMP since it was unused. | (in-package :coleslaw)
(defun date-to-timestamp (date)
"Convert a post DATE to a local-time timestamp."
(destructuring-bind (date time) (cl-ppcre:split " " date)
(apply 'local-time:encode-timestamp 0
(mapcar #'parse-integer
(append (reverse (cl-ppcre:split ":" time))
... | (in-package :coleslaw)
(defun make-pubdate (&optional date)
"Make a RFC1123 pubdate representing the current time or DATE, when supplied."
(let ((timestamp (if date
(date-to-timestamp date)
(local-time:now))))
(local-time:format-rfc1123-timestring nil timestamp)))
... |
Add method on PRINT-OBJECT specialized to BUILT-IN-CLASS. | (cl:in-package #:sicl-boot)
(defmethod print-object ((class standard-class) stream)
(format stream
"#<Ersatz standard class ~s>"
(sicl-clos:class-name class)))
| (cl:in-package #:sicl-boot)
(defmethod print-object ((class standard-class) stream)
(format stream
"#<Ersatz standard class ~s>"
(sicl-clos:class-name class)))
(defmethod print-object ((class sicl-clos:built-in-class) stream)
(format stream
"#<Ersatz built-in class ~s>"
(sicl-clos:class-name class)))
|
Add function to save database to file | (defun make-cd (title artist rating ripped)
(list :title title :artist artist :rating rating :ripped ripped))
(defvar *db* nil)
(defun add-cd (cd)
(push cd *db*))
(defun dump-db ()
(dolist (cd *db*)
(format t "~{~a:~10t~a~%~}~%" cd)))
(defun dump-db-short ()
(format t "~{~{~a:~10t~a~%~}~%~}" *db*))
(de... | (defun make-cd (title artist rating ripped)
(list :title title :artist artist :rating rating :ripped ripped))
(defvar *db* nil)
(defun add-cd (cd)
(push cd *db*))
(defun dump-db ()
(dolist (cd *db*)
(format t "~{~a:~10t~a~%~}~%" cd)))
(defun dump-db-short ()
(format t "~{~{~a:~10t~a~%~}~%~}" *db*))
(de... |
Make sure the :it.bese suite is defined in time. | ;;;; -*- lisp -*-
(defpackage :it.bese.yaclml.test
(:use :common-lisp
:arnesi
:iterate
:it.bese.yaclml
:it.bese.FiveAM))
(unless (5am:get-test :it.bese)
(5am:def-suite :it.bese))
(5am:def-suite :it.bese.yaclml :in :it.bese)
| ;;;; -*- lisp -*-
(defpackage :it.bese.yaclml.test
(:use :common-lisp
:arnesi
:iterate
:it.bese.yaclml
:it.bese.FiveAM))
(eval-when (:compile-toplevel :load-toplevel :execute)
(unless (5am:get-test :it.bese)
(5am:def-suite :it.bese)))
(5am:def-suite :it.bese.yaclml :in :it.bese)
|
Use new Cleavir function to find the global environment. | (cl:in-package #:sicl-global-environment)
(defvar *global-environment*)
(defun expand-place (place environment)
(when (null environment)
(setf environment *global-environment*))
(cond ((symbolp place)
(let ((expansion (cleavir-env:symbol-macro-expansion place environment)))
(if (eq place expansion)
... | (cl:in-package #:sicl-global-environment)
(defvar *global-environment*)
(defun expand-place (place environment)
(when (null environment)
(setf environment *global-environment*))
(cond ((symbolp place)
(let ((expansion (cleavir-env:symbol-macro-expansion place environment)))
(if (eq place expansion)
... |
Use EQL instead of STRING== to find selected options. | (fn html-option (value name selected)
(string-concat "<option value=\"" value "\""
(& (string== selected value)
" selected")
">" name "</option>"))
(fn html-options (x selected)
(apply #'string-concat (@ [html-option _. ._ selected] x)))
| (fn html-option (value name selected)
(string-concat "<option value=\"" value "\""
(& (eql selected value)
" selected")
">" name "</option>"))
(fn html-options (x selected)
(apply #'string-concat (@ [html-option _. ._ selected] x)))
|
Remove definition of TYPEP in preparation for a new one as a generic function. | (cl:in-package #:sicl-boot-phase1)
(defun ld (filename environment)
(format *trace-output* "Loading file ~a~%" filename)
(finish-output *trace-output*)
(sicl-extrinsic-environment:load-source-with-environments
filename (compilation-environment environment) environment))
(defun fill-environment (environment)
... | (cl:in-package #:sicl-boot-phase1)
(defun ld (filename environment)
(format *trace-output* "Loading file ~a~%" filename)
(finish-output *trace-output*)
(sicl-extrinsic-environment:load-source-with-environments
filename (compilation-environment environment) environment))
(defun fill-environment (environment)
... |
Add in stub string for the exercise. | (defpackage #:hello-world
(:use #:cl)
(:export #:hello))
(in-package #:hello-world)
(defun hello ())
| (defpackage #:hello-world
(:use #:cl)
(:export #:hello))
(in-package #:hello-world)
(defun hello () "Put your greeting here.")
|
Implement for SBCL; implement for all other platforms using CLOCC PORT. | ;;; An interface to Kpathsea (TeX's file search library)
;;; Copr. 2002 Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de>
;;; This is free software, licensed under GNU GPL (see file COPYING)
(in-package :kpathsea)
(defun find-file (name)
#+cmu
(let ((process
(extensions:run-program "kpsewhich" (list (namestr... | ;;; An interface to Kpathsea (TeX's file search library)
;;; Copr. 2002 Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de>
;;; This is free software, licensed under GNU GPL (see file COPYING)
(in-package :kpathsea)
;; We use CLOCC PORT to run programs if we are not running in CMUCL or SBCL.
#-(or cmu sbcl)
(require... |
Load the CBM basic keywords. | ; bender – Copyright (c) 2014–2015 Sven Michael Klose <pixel@copei.de>
(load "./environment/platforms/shared/read-binary.lisp")
(load "./environment/platforms/shared/xml2lml.lisp")
(load "src/6502.lisp")
(load "src/instruction.lisp")
(load "src/print.lisp")
(load "src/disassembler.lisp")
(load "src/instruction-map.li... | ; bender – Copyright (c) 2014–2015 Sven Michael Klose <pixel@copei.de>
(load "./environment/platforms/shared/read-binary.lisp")
(load "./environment/platforms/shared/xml2lml.lisp")
(load "src/6502.lisp")
(load "src/instruction.lisp")
(load "src/print.lisp")
(load "src/disassembler.lisp")
(load "src/instruction-map.li... |
Define a class for representing a list of optional parameters. | (cl:in-package #:cleavir-cst)
(defclass optional-parameter ()
(;; This slot contains the CST for the obligatory variable of the
;; optional parameter.
(%variable-cst :initarg :variable-cst :reader variable-cst)
;; This slot contains a CST for the INIT-FORM of the optional
;; parameter. If no INIT-FORM w... | (cl:in-package #:cleavir-cst)
(defclass optional-parameter ()
(;; This slot contains the CST for the obligatory variable of the
;; optional parameter.
(%variable-cst :initarg :variable-cst :reader variable-cst)
;; This slot contains a CST for the INIT-FORM of the optional
;; parameter. If no INIT-FORM w... |
Use NOT instead of EQ - breaks transpiler/javascript otherwise. | ;;;; nix operating system project
;;;; list processor environment
;;;; Copyright (C) 2005 Sven Klose <pixel@copei.de>
;;;;
;;;; Basic conditional operators
(defmacro if (test true &optional false)
(cond
(false
`(cond
(,test ,true)
(t ,false)))
(t `(cond (,test ,true)))))
(%defun comp... | ;;;; nix operating system project
;;;; list processor environment
;;;; Copyright (C) 2005 Sven Klose <pixel@copei.de>
;;;;
;;;; Basic conditional operators
(defmacro if (test true &optional false)
(cond
(false
`(cond
(,test ,true)
(t ,false)))
(t `(cond (,test ,true)))))
(%defun comp... |
Use explicit package prefix with IN-PACKAGE. | (in-package #:asdf-user)
(defsystem :sicl-iteration-support
:depends-on (:cleavir-code-utilities
:cleavir-internationalization)
:serial t
:components
((:file "packages")
(:file "conditions")
(:file "utilities")
(:file "condition-reporters-en")
(:file "docstrings-en")))
| (cl:in-package #:asdf-user)
(defsystem :sicl-iteration-support
:depends-on (:cleavir-code-utilities
:cleavir-internationalization)
:serial t
:components
((:file "packages")
(:file "conditions")
(:file "utilities")
(:file "condition-reporters-en")
(:file "docstrings-en")))
|
Fix case in debug message. | ;;;; SPDX-FileCopyrightText: Atlas Engineer LLC
;;;; SPDX-License-Identifier: BSD-3-Clause
;;;; This file produces two warnings due to redefinitions of
;;;; renderer-thread-p and ffi-initialize.
;;;;
;;;; This is necessary to modify the behavior of renderer-gtk to use
;;;; gobject to launch/manage the main GTK thread.... | ;;;; SPDX-FileCopyrightText: Atlas Engineer LLC
;;;; SPDX-License-Identifier: BSD-3-Clause
;;;; This file produces two warnings due to redefinitions of
;;;; renderer-thread-p and ffi-initialize.
;;;;
;;;; This is necessary to modify the behavior of renderer-gtk to use
;;;; gobject to launch/manage the main GTK thread.... |
Add copyright dates and license statement. | (cl:in-package #:sicl-clos)
(defclass standard-direct-slot-definition
(standard-slot-definition direct-slot-definition)
())
| ;;;; Copyright (c) 2013 - 2015
;;;;
;;;; Robert Strandh (robert.strandh@gmail.com)
;;;;
;;;; All rights reserved.
;;;;
;;;; Redistribution and use in source and binary forms, with or
;;;; without modification, are permitted provided that the following
;;;; conditions are met:
;;;;
;;;; 1. Redistributions of source ... |
Use new function for processing forms read. | (cl:in-package #:cleavir-generate-ast)
(defun ast-from-stream (stream environment system)
(let ((*compiler* 'compile-file))
(cleavir-ast:make-progn-ast
(let ((eof (list nil)))
(loop for form = (read stream nil eof)
until (eq form eof)
collect (generate-ast form environment system))))))
(... | (cl:in-package #:cleavir-generate-ast)
(defun ast-from-stream (stream environment system)
(let ((*compiler* 'compile-file))
(process-progn
(let ((eof (list nil)))
(loop for form = (read stream nil eof)
until (eq form eof)
collect (generate-ast form environment system))))))
(defun ast-fro... |
Write error logs in HANDLE-ERROR | (in-package #:eloquent.mvc.middleware)
(defun error-to-body (e)
"Convert the backtrace of E into a string."
(check-type e error)
(trivial-backtrace:print-backtrace e :output nil))
(defun handle-error (request next &key)
"Execute the NEXT, catch the error it signaled, if any, and make a HTTP error response."
... | (in-package #:eloquent.mvc.middleware)
(defun error-log (e)
"Write the message and backtrace of E to error log file."
(let ((body (error-to-body e)))
(dolist (line (eloquent.mvc.prelude:split body #\Newline
:remove-empty-subseqs t))
(eloquent.mvc.logger:forma... |
Add version information to ASDF. | ;;;; nebula.asd
(asdf:defsystem #:nebula
:serial t
:description "Describe nebula here"
:author "K. Isom <kyle@metacircular.net>"
:license "MIT"
:depends-on (#:cl-ppcre
#:cl-who
#:flexi-streams
#:ironclad
#:local-time
#:log4cl
#:postmodern
#:swank
... | ;;;; nebula.asd
(asdf:defsystem #:nebula
:serial t
:description "Describe nebula here"
:author "K. Isom <kyle@metacircular.net>"
:license "MIT"
:version 0.2.0
:depends-on (#:cl-ppcre
#:cl-who
#:flexi-streams
#:ironclad
#:local-time
#:log4cl
#:postmodern
... |
Return T if atom has a name. | ;;;;; TRE environment
;;;;; Copyright (c) 2005-2006,2008 Sven Klose <pixel@copei.de>
;;;;;
;;;;; Predicate functions
(defun zerop (x)
"Return T if the argument value is 0."
(eq x 0))
(defun evenp (x)
"Return T if x is an even number."
(= 0 (mod x 2)))
(defun null (x)
"Return T if argument is non-atomic."
... | ;;;;; TRE environment
;;;;; Copyright (c) 2005-2006,2008-2009 Sven Klose <pixel@copei.de>
;;;;;
;;;;; Predicate functions
(defun zerop (x)
"Return T if the argument value is 0."
(eq x 0))
(defun evenp (x)
"Return T if x is an even number."
(= 0 (mod x 2)))
(defun null (x)
"Return T if argument is non-atomi... |
Copy *TARGETS* from host environment. | ; tré – Copyright (c) 2014 Sven Michael Klose <pixel@copei.de>
(defvar *universe* nil)
(defvar *variables* nil)
(defvar *launchfile* nil)
(defvar *pointer-size* 4)
(defvar *assert* t)
(defvar *targets* '(:c :cl :js :php))
(defvar *endianess* nil)
(defvar *cpu-type* nil)
(defvar *libc-path* nil)
(defvar *rand-max* nil)... | ; tré – Copyright (c) 2014–2015 Sven Michael Klose <pixel@copei.de>
(defvar *universe* nil)
(defvar *variables* nil)
(defvar *launchfile* nil)
(defvar *pointer-size* 4)
(defvar *assert* t)
(defvar *targets* ,`',*targets*)
(defvar *endianess* nil)
(defvar *cpu-type* nil)
(defvar *libc-path* nil)
(defvar *rand-max* nil)... |
Set to return queue on push |
(defpackage :things.utils
(:documentation "Various useful and useless utils.")
(:use #:cl)
(:export #:qpush #:qpop))
(in-package :things.utils)
(defun qpush (queue item)
"Pushes a value into a queue."
(if queue
(let ((n (list item)))
(setf (cdr (cdr queue)) n)
(setf (cdr queue) (last ... |
(defpackage :things.utils
(:documentation "Various useful and useless utils.")
(:use #:cl)
(:export #:qpush #:qpop))
(in-package :things.utils)
(defun qpush (queue item)
"Pushes a value into a queue."
(if queue
(let ((n (list item)))
(setf (cdr (cdr queue)) n)
(setf (cdr queue) (last ... |
Add optional paramater next as lambda expressions for sigma-sum | ;; Common Lisp Script
;; Manoel Vilela
;; higher-order function sigma-sum
;; func must be a lambda(x) expression
(defun sigma-sum (func a b)
(if (> a b)
0
(+ (funcall func a)
(sigma-sum func (1+ a) b))))
(defun square (x)
(* x x))
(sigma-sum #'(lambda(x) (/ 1 x)) 1 10)
(sigma-sum #'(lambda(... | ;; Common Lisp Script
;; Manoel Vilela
;; higher-order function sigma-sum
;; func must be a lambda(x) expression
(defun sigma-sum (func a b &key (next #'1+))
(if (> a b)
0
(+ (funcall func a)
(sigma-sum func (funcall next a) b))))
(defun square (x)
(* x x))
(sigma-sum #'(lambda(x) (/ 1 x)) ... |
Add required parameter for the class of the nodes to create. | (cl:in-package #:clump-test)
(defun random-tree (&optional (node-probability 1.0))
(if (< (random 1.0) node-probability)
(make-instance 'node
:data (random 20)
:left (random-tree (* 0.9 node-probability))
:right (random-tree (* 0.9 node-probability)))
nil))
| (cl:in-package #:clump-test)
(defun random-tree (node-class &optional (node-probability 1.0))
(if (< (random 1.0) node-probability)
(make-instance node-class
:data (random 20)
:left (random-tree node-class (* 0.9 node-probability))
:right (random-tree node-class (* 0.9 node-probability)))
nil))
|
Add comments with the Project Euler problem text | (in-package #:euler)
(defun problem-1 ()
(loop :for i :from 1 :below 1000
:when (or (dividesp i 3)
(dividesp i 5))
:sum i))
(defun problem-2 ()
(loop :with p = 0
:with n = 1
:while (<= n 4000000)
:when (evenp n) :sum n
:do (psetf p n
... | (in-package #:euler)
(defun problem-1 ()
;; If we list all the natural numbers below 10 that are multiples of 3 or 5,
;; we get 3, 5, 6 and 9. The sum of these multiples is 23.
;;
;; Find the sum of all the multiples of 3 or 5 below 1000.
(loop :for i :from 1 :below 1000
:when (or (dividesp i 3)
... |
Reset program counter before dumping the listing. | ; bender – Copyright (c) 2014–2015 Sven Michael Klose <pixel@copei.de>
(defun assemble-parsed-files (x)
(alet (assemble-multiple-passes x)
(unless *unassigned-segment-blocks*
(return !)))
(format t "Assembling again to assign BLOCKs to SEGMENTS…~%")
(sort-unassigned-segment-blocks)
(with-temporary *a... | ; bender – Copyright (c) 2014–2015 Sven Michael Klose <pixel@copei.de>
(defun assemble-parsed-files (x)
(alet (assemble-multiple-passes x)
(unless *unassigned-segment-blocks*
(return !)))
(format t "Assembling again to assign BLOCKs to SEGMENTS…~%")
(sort-unassigned-segment-blocks)
(with-temporary *a... |
Rename ALPHABETICP to ALPHABETIC for consistency. | ;;;; SPDX-License-Identifier: BSD-3-Clause
(in-package :text-analysis)
(defun word-tokenize (string &key (remove-stop-words t) (stem nil) (down-case t) (alphabeticp t))
"Split a string into a list of words."
(let* ((alpha-scanner (cl-ppcre:create-scanner "^[A-Za-z]*$"))
(tokens (str:split " " (str:collap... | ;;;; SPDX-License-Identifier: BSD-3-Clause
(in-package :text-analysis)
(defun word-tokenize (string &key (remove-stop-words t) (stem nil) (down-case t) (alphabetic t))
"Split a string into a list of words."
(let* ((alpha-scanner (cl-ppcre:create-scanner "^[A-Za-z]*$"))
(tokens (str:split " " (str:collaps... |
Load files containing recently-defined macros. | (cl:in-package #:sicl-extrinsic-hir-compiler)
(defun rp (filename)
(asdf:system-relative-pathname :sicl-extrinsic-hir-compiler filename))
(load (rp "../../Evaluation-and-compilation/lambda.lisp"))
(load (rp "../../Environment/multiple-value-bind.lisp"))
(load (rp "../../Data-and-control-flow/setf.lisp"))
(load (rp ... | (cl:in-package #:sicl-extrinsic-hir-compiler)
(defun rp (filename)
(asdf:system-relative-pathname :sicl-extrinsic-hir-compiler filename))
(load (rp "../../Evaluation-and-compilation/lambda.lisp"))
(load (rp "../../Environment/multiple-value-bind.lisp"))
(load (rp "../../Data-and-control-flow/setf.lisp"))
(load (rp ... |
Add copyright dates and license statement. | (cl:in-package #:sicl-clos)
(defclass effective-slot-definition (slot-definition)
((%location
:initform nil
:initarg :location
:accessor slot-definition-location)))
| ;;;; Copyright (c) 2013 - 2015
;;;;
;;;; Robert Strandh (robert.strandh@gmail.com)
;;;;
;;;; All rights reserved.
;;;;
;;;; Redistribution and use in source and binary forms, with or
;;;; without modification, are permitted provided that the following
;;;; conditions are met:
;;;;
;;;; 1. Redistributions of source ... |
Add :immediate-flush to self-config options also | ;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
;;;
;;; Copyright (c) 2012, Max Mikhanosha. All rights reserved.
;;;
;;; This file is licensed to You under the Apache License, Version 2.0
;;; (the "License"); you may not use this file except in compliance
;;; with the License. You may obtain a copy of the L... | ;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
;;;
;;; Copyright (c) 2012, Max Mikhanosha. All rights reserved.
;;;
;;; This file is licensed to You under the Apache License, Version 2.0
;;; (the "License"); you may not use this file except in compliance
;;; with the License. You may obtain a copy of the L... |
Test on end of stream. | ;;;; TRE environment
;;;; Copyright (c) 2008 Sven Klose <pixel@copei.de>
(defun read-integer (&optional (str *standard-input*))
(with (rec #'(()
(if (digit-char-p (peek-char str))
(+ (- #\0 (read-char str)) (rec))
0)))
(when (digit-char-p (peek-char str))
(rec))))
| ;;;; TRE environment
;;;; Copyright (c) 2008 Sven Klose <pixel@copei.de>
(defun read-integer (&optional (str *standard-input*))
"Read positive integer from stream."
(with (rec #'((v)
(if (awhen (peek-char str)
(digit-char-p !))
(rec (+ (- (read-char str) #\0)
(* v 10)))
v)))
... |
Load absorb-force lesson on startup | (asdf:defsystem :bld-ssweb
:name "bld-ssweb"
:author "Benjamin L. Diedrich <ben@solarsails.info>"
:license "MIT"
:description "Solar Sail Web Application"
:depends-on ("bld-utils" "bld-ode" "hunchentoot" "cl-who" "parenscript" "css-lite" "cl-json" "ht-simple-ajax" "cl-fad" "cl-csv")
:serial t
:components
... | (asdf:defsystem :bld-ssweb
:name "bld-ssweb"
:author "Benjamin L. Diedrich <ben@solarsails.info>"
:license "MIT"
:description "Solar Sail Web Application"
:depends-on ("bld-utils" "bld-ode" "hunchentoot" "cl-who" "parenscript" "css-lite" "cl-json" "ht-simple-ajax" "cl-fad" "cl-csv")
:serial t
:components
... |
Upgrade to latest quiclisp dist | (defvar *dist-url* "http://beta.quicklisp.org/dist/quicklisp/2017-02-27/distinfo.txt")
(load "quicklisp.lisp")
(quicklisp-quickstart:install :path "/opt/app-root/quicklisp/" :dist-url *dist-url*)
; Pre-load/compile useful content...
(ql:quickload :hunchentoot)
(ql:quickload :swank)
(with-open-file (out "/opt/app-ro... | (defvar *dist-url* "http://beta.quicklisp.org/dist/quicklisp/2017-04-03/distinfo.txt")
(load "quicklisp.lisp")
(quicklisp-quickstart:install :path "/opt/app-root/quicklisp/" :dist-url *dist-url*)
; Pre-load/compile useful content...
(ql:quickload :hunchentoot)
(ql:quickload :swank)
(with-open-file (out "/opt/app-ro... |
Add default initarg to :LOCK of FILE-MONITOR class. | ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
;;;
;;; file-monitor.lisp --- Monitor files on disk.
;;;
(in-package :net.sockets)
(defclass file-monitor ()
((file :initform (error "Must supply a file name")
:initarg :file :accessor file-of)
(timestamp :initarg :timestamp :acces... | ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
;;;
;;; file-monitor.lisp --- Monitor files on disk.
;;;
(in-package :net.sockets)
(defclass file-monitor ()
((file :initform (error "Must supply a file name")
:initarg :file :accessor file-of)
(timestamp :initarg :timestamp :acces... |
Load the definition of CL:FBOUNDP. | (cl:in-package #:sicl-extrinsic-hir-compiler)
(defun rp (filename)
(asdf:system-relative-pathname :sicl-extrinsic-hir-compiler filename))
(load (rp "../../Evaluation-and-compilation/lambda.lisp"))
(load (rp "../../Environment/multiple-value-bind.lisp"))
(load (rp "../../Data-and-control-flow/setf.lisp"))
(load (rp ... | (cl:in-package #:sicl-extrinsic-hir-compiler)
(defun rp (filename)
(asdf:system-relative-pathname :sicl-extrinsic-hir-compiler filename))
(load (rp "../../Evaluation-and-compilation/lambda.lisp"))
(load (rp "../../Environment/multiple-value-bind.lisp"))
(load (rp "../../Data-and-control-flow/setf.lisp"))
(load (rp ... |
Add TODO for passing in version info and compression type | (in-package :cqlcl)
(defclass connection ()
;; TODO maybe this should hold an instance of a parser
((conn :accessor conn :initarg :conn)))
(defun make-connection (&optional (host "localhost") (port 9042))
(let ((conn (usocket:socket-stream
(usocket:socket-connect host port :element-type '(unsign... | (in-package :cqlcl)
(defclass connection ()
;; TODO maybe this should hold an instance of a parser
((conn :accessor conn :initarg :conn)))
(defun make-connection (&optional (host "localhost") (port 9042)); TODO: &key version compression)
(let ((conn (usocket:socket-stream
(usocket:socket-connect... |
Remove component defining temporary version of STANDARD-CLASS. | (cl:in-package #:asdf-user)
(defsystem :sicl-boot-phase1
:depends-on (:sicl-extrinsic-environment)
:serial t
:components
((:file "packages")
(:file "temporary-standard-class")
(:file "fill")
(:file "environment")))
| (cl:in-package #:asdf-user)
(defsystem :sicl-boot-phase1
:depends-on (:sicl-extrinsic-environment)
:serial t
:components
((:file "packages")
(:file "fill")
(:file "environment")))
|
Use cl:defpackage for the freetype package, no matter what. | (defpackage :mcclim-freetype
(:use :climi :clim :clim-lisp)
(:export :*freetype-font-path*)
(:import-from #+(or cmu scl) :alien
#+sbcl :sb-alien
:slot :make-alien :alien :deref))
| (cl:defpackage :mcclim-freetype
(:use :climi :clim :clim-lisp)
(:export :*freetype-font-path*)
(:import-from #+(or cmu scl) :alien
#+sbcl :sb-alien
:slot :make-alien :alien :deref))
|
Improve *benchmark* and its documentation. | (in-package :6502)
(defparameter *benchmark*
'(;; Clear the Decimal and Carry status bits
#xd8 ; $0000 d8 CLD
#x18 ; $0001 18 CLC
;; Set the Accumulator and X and Y regs to zero
#xa9 #x00 ; $0002 a9 00 LDA #$00
#xa2 #x00 ; $0004 a2 00 LDX #$00
#xa0 #x00 ; $0006 a0 00 LDY ... | (in-package :6502)
(defparameter *benchmark*
'(;; Clear the Decimal and Carry status bits
#xd8 ; $0000 d8 CLD
#x18 ; $0001 18 CLC
;; Set the Accumulator and X and Y regs to zero
#xa9 #x00 ; $0002 a9 00 LDA #$00
#xa2 #x00 ; $0004 a2 00 LDX #$00
#xa0 #x00 ; $0006 a0 00 LDY ... |
Define system in package ASDF-USER. | (cl:in-package #:common-lisp-user)
(asdf:defsystem :cleavir-test-utilities
:depends-on (:cleavir-utilities)
:components
((:file "packages")
(:file "test-utilities" :depends-on ("packages"))))
| (cl:in-package #:asdf-user)
(defsystem :cleavir-test-utilities
:depends-on (:cleavir-utilities)
:components
((:file "packages")
(:file "test-utilities" :depends-on ("packages"))))
|
Add swank. Uses port 4005. | (defvar *dist-url* "http://beta.quicklisp.org/dist/quicklisp/2016-08-25/distinfo.txt")
(load "quicklisp.lisp")
(quicklisp-quickstart:install :path "/opt/app-root/quicklisp/" :dist-url *dist-url*)
; Pre-load/compile useful content...
(ql:quickload :hunchentoot)
(with-open-file (out "/opt/app-root/.sbclrc" :direction... | (defvar *dist-url* "http://beta.quicklisp.org/dist/quicklisp/2016-08-25/distinfo.txt")
(load "quicklisp.lisp")
(quicklisp-quickstart:install :path "/opt/app-root/quicklisp/" :dist-url *dist-url*)
; Pre-load/compile useful content...
(ql:quickload :hunchentoot)
(ql:quickload :swank)
(with-open-file (out "/opt/app-ro... |
Support passing keyword as encoder to RESPOND | (in-package #:eloquent.mvc.response)
(defun respond (body
&key
(encoder #'identity)
(headers '())
(status 200))
(make-instance '<response>
:body (funcall encoder body)
:status status
:headers head... | (in-package #:eloquent.mvc.response)
(defun respond (body
&key
(encoder #'identity)
(headers '())
(status 200))
(when (keywordp encoder)
(setf encoder (make-encoder encoder)))
(make-instance '<response>
:body (funcall encode... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.