commit stringlengths 40 40 | old_file stringlengths 4 264 | new_file stringlengths 4 264 | old_contents stringlengths 0 4.24k | new_contents stringlengths 1 5.44k | subject stringlengths 14 778 | message stringlengths 15 9.92k | lang stringclasses 277
values | license stringclasses 13
values | repos stringlengths 5 127k |
|---|---|---|---|---|---|---|---|---|---|
b1f0a06e53325e23dad7cde51ed5008f300983ec | source/in_wch.lisp | source/in_wch.lisp | (in-package :de.anvi.croatoan)
(defun extract-wide-char (window &key y x)
"Extract and return a wide character (code > 255) from the window.
If the destination coordinates y and x are given, first move the cursor."
(when (and y x) (move window y x))
;; we absolutely need cchar_t here, cchar crashes sbcl.
(wit... | (in-package :de.anvi.croatoan)
(defun extract-wide-char (window &key y x)
"Extract and return a single (complex) character from the window.
This includes wide characters (code > 255), and requires the ncursesw library.
If the destination coordinates y and x are given, move the cursor first."
(when (and y x) (mov... | Refactor extract-wide-char to avoid using plists | Refactor extract-wide-char to avoid using plists
Use foreign-slot-pointer and foreign-slot-value instead of
convert-from-foreign.
Use helper functions to extract attributes.
| Common Lisp | mit | McParen/croatoan |
dfaaed935151fc3d50fa6be7d4248fc134112c0a | t/numbers.lisp | t/numbers.lisp | ;;;; -*- lisp -*-
(in-package :it.bese.arnesi)
(def-suite :it.bese.arnesi.numbers :in :it.bese.arnesi)
(in-suite :it.bese.arnesi.numbers)
(test mulf
(let ((a 0))
(is (= 0 (mulf a 10)))
(is (= 0 a)))
(let ((a 1))
(is (= 4 (mulf a 4)))
(is (= 1 (mulf a (/ 4))))
(is (= 1 a))))
(test minf
(l... | ;;;; -*- lisp -*-
(in-package :it.bese.arnesi)
(def-suite :it.bese.arnesi.numbers :in :it.bese.arnesi)
(in-suite :it.bese.arnesi.numbers)
(test mulf
(let ((a 0))
(is (= 0 (mulf a 10)))
(is (= 0 a)))
(let ((a 1))
(is (= 4 (mulf a 4)))
(is (= 1 (mulf a (/ 4))))
(is (= 1 a))))
(test minf
(l... | Use FiveAM's new random testing for the parse-float test | Use FiveAM's new random testing for the parse-float test
darcs-hash:20060124140012-dd2a1-3d8e2da1166317bcce072289d9f721be2002a19e.gz
| Common Lisp | bsd-3-clause | angavrilov/cl-walker |
5255577a9f4dc921a615bb56b83d082a9a448d8d | environment/alien/unix.lisp | environment/alien/unix.lisp | ;;;; TRE environment
;;;; Copyright (c) 2008 Sven Klose <pixel@copei.de>
;;;;
;;;; UN*X shell commands
(defun unix-sh-rm (file)
(exec "/bin/rm" (list file)))
(defun unix-sh-mv (from to)
(exec "/bin/mv" (list from to)))
(defun unix-sh-cp (from to &key (recursively? nil))
(exec "/bin/cp" (append (when recursivel... | ;;;; TRE environment
;;;; Copyright (c) 2008 Sven Klose <pixel@copei.de>
;;;;
;;;; UN*X shell commands
(defun unix-sh-rm (file &key (recursively? nil) (force? nil))
(exec "/bin/rm" (append (when recursively?
(list "-r"))
(when force?
(list "-f"))
(list file))))
(defun unix-sh-mv ... | Allow flags -r and -f. | UNIX-SH-RM: Allow flags -r and -f.
| Common Lisp | mit | SvenMichaelKlose/tre,SvenMichaelKlose/tre,SvenMichaelKlose/tre |
5f4e282fe7a622f892f9e3a79bcc5e6612cb99eb | environment/transpiler/targets/javascript/environment/hash.lisp | environment/transpiler/targets/javascript/environment/hash.lisp | ;;;;; TRE to ECMAScript transpiler
;;;;; Copyright (c) 2009 Sven Klose <pixel@copei.de>
(defun hash-table? (x)
(and (objectp x)
(undefined? x.__class)))
(defun hash-assoc (x)
(let lst nil
(maphash #'((k v)
(push! (cons k v) lst))
x)
(reverse lst)))
;; XXX test is ignored.
(defun a... | ;;;;; TRE to ECMAScript transpiler
;;;;; Copyright (c) 2009-2010 Sven Klose <pixel@copei.de>
(defun hash-table? (x)
(and (objectp x)
(undefined? x.__class)))
(defun hash-assoc (x)
(let lst nil
(maphash #'((k v)
(push! (cons k v) lst))
x)
(reverse lst)))
;; XXX test is ignored.
(de... | Use default values for keyword arguments. | Use default values for keyword arguments.
| Common Lisp | mit | SvenMichaelKlose/tre,SvenMichaelKlose/tre,SvenMichaelKlose/tre |
7da68e51b1e727443be6905353a8ba02a846b52c | contact.lisp | contact.lisp | ;;;;; Copyright (c) 2012–2014 Sven Michael Klose <pixel@copei.de>
(defvar *contact-to*)
(defvar *contact-subject*)
(defun contact-mail-header ()
(alet (@ (form-data) 'email)
(+ "From: " ! *terpri*
"Reply-To: " ! *terpri*)))
(defun send-contact-mail ()
(mail *contact-to* *contact-subject*
(@ (f... | ; Copyright (c) 2012–2014,2016 Sven Michael Klose <pixel@copei.de>
(defvar *contact-to*)
(defvar *contact-subject*)
(defun contact-mail-header ()
(alet (href (form-data) 'email)
(+ "From: " ! *terpri*
"Reply-To: " ! *terpri*)))
(defun send-contact-mail ()
(mail *contact-to* *contact-subject*
(... | Fix access to form data array. | Fix access to form data array.
| Common Lisp | mit | SvenMichaelKlose/phitamine-shop,SvenMichaelKlose/phitamine-shop,SvenMichaelKlose/phitamine-shop |
3dc1ec84f7002e8207c4f5482be4ec1c87638e14 | Code/Format/sicl-format-test.asd | Code/Format/sicl-format-test.asd | (cl:in-package #:asdf-user)
(defsystem :sicl-format-test
:depends-on (:lisp-unit :sicl-format)
:components
((:file "format-test" :depends-on ())))
| (cl:in-package #:asdf-user)
(defsystem :sicl-format-test
:depends-on (:lisp-unit :sicl-format)
:serial t
:components
((:file "format-test")))
| Use option :SERIAL T for test system. | Use option :SERIAL T for test system.
| Common Lisp | bsd-2-clause | clasp-developers/SICL,clasp-developers/SICL,vtomole/SICL,vtomole/SICL,vtomole/SICL,vtomole/SICL,clasp-developers/SICL,clasp-developers/SICL |
fdb552d7f731a6394f46852c8b0b33911f95bdde | core/classes.lisp | core/classes.lisp | (in-package #:factual.core)
(defclass deb-package ()
((depends :accessor depends :initform nil)
(data-files :accessor data-files :initform nil)))
(defclass node ()
((name :accessor name :initarg :name :type string)
(path :reader path :initarg :path :type pathname)
(packages :accessor packages :type list)... | (in-package #:factual.core)
(defclass deb-package ()
((depends :accessor depends :initform nil)
(data-files :accessor data-files :initform nil)))
(defclass node ()
((name :accessor name :initarg :name :type string)
(path :reader path :initarg :path :type pathname)
(packages :accessor packages :type list)... | Define a better deb package name. | Define a better deb package name.
| Common Lisp | mit | ralt/factual |
f1f0a3b784c254528bf7c54398ea4f1bf826abd7 | Binary-tree/iterative-traversal.lisp | Binary-tree/iterative-traversal.lisp | (cl:in-package #:clump-binary-tree)
(defgeneric iterative-traversal (tree enter))
(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))))
(loop... | (cl:in-package #:clump-binary-tree)
(defgeneric iterative-traversal (tree enter))
(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))))
(loop... | Call function LEAVE when moving up the tree. | Call function LEAVE when moving up the tree.
| Common Lisp | bsd-2-clause | robert-strandh/Clump |
1d4312f01f8c118282c2732e298cd81ff7dd4ace | src/packages.lisp | src/packages.lisp | (defpackage :coleslaw
(:documentation "Homepage: <a href=\"http://github.com/redline6561/coleslaw\">Github</a>")
(:use :cl)
(:import-from :alexandria #:hash-table-values
#:make-keyword
#:mappend)
(:import-from :closure-template #:compile-template)
(:expo... | (defpackage :coleslaw
(:documentation "Homepage: <a href=\"http://github.com/redline6561/coleslaw\">Github</a>")
(:use :cl)
(:import-from :alexandria #:hash-table-values
#:make-keyword
#:mappend)
(:import-from :closure-template #:compile-template)
(:expo... | Update export list to expose new API. | Update export list to expose new API.
| Common Lisp | bsd-2-clause | Ferada/coleslaw,redline6561/coleslaw,superjudge/coleslaw,6x13/coleslaw,kingcons/coleslaw |
ac6392586278c8e2777750afdf01a9c32ee09ec4 | cl-libevent2.asd | cl-libevent2.asd | (asdf:defsystem cl-libevent2
:author "Andrew Danger Lyon <orthecreedence@gmail.com>"
:license "MIT"
:version "0.1.5"
:description "Low-level libevent2 bindings for Common Lisp."
:depends-on (#:cffi #:cffi-libffi)
:components ((:file "libevent2")
(:file "wrapper" :depends-on ("libevent2"))
... | (asdf:defsystem cl-libevent2
:author "Andrew Danger Lyon <orthecreedence@gmail.com>"
:license "MIT"
:version "0.1.5"
:description "Low-level libevent2 bindings for Common Lisp."
:depends-on (#:cffi)
:components ((:file "libevent2")
(:file "wrapper" :depends-on ("libevent2"))
(:... | Revert "Add the system CFFI-LIBFFI to ASDF dependencies." | Revert "Add the system CFFI-LIBFFI to ASDF dependencies."
This reverts commit 2bf722c0748076a954c57e2d30edc90067653d52.
| Common Lisp | mit | orthecreedence/cl-libevent2,orthecreedence/cl-libevent2 |
2f1c664af6b58794f0400f105d0d793dd9de6e6b | tests/tests.lisp | tests/tests.lisp | (cl:defpackage #:cartesian-product-switch_tests
(:use #:cl #:parachute)
(:import-from #:cartesian-product-switch #:cartesian-product-switch))
(cl:in-package #:cartesian-product-switch_tests)
(define-test "featured-example"
(flet ((test (manner direction expected)
(flet ((invoke ()
... | (cl:defpackage #:cartesian-product-switch_tests
(:use #:cl #:parachute)
(:import-from #:cartesian-product-switch #:cartesian-product-switch))
(cl:in-package #:cartesian-product-switch_tests)
(define-test "featured-example"
(flet ((test (manner direction expected)
(flet ((invoke ()
... | Use proper argument order for IS. | Tests: Use proper argument order for IS.
| Common Lisp | unlicense | Hexstream/cartesian-product-switch |
79785f01d8e1c4eb806dc2a1bdedaa3db34ada57 | Code/Backends/Extrinsic-HIR-interpreter/instructions.lisp | Code/Backends/Extrinsic-HIR-interpreter/instructions.lisp | (cl:in-package #:sicl-extrinsic-hir-interpreter)
(defclass enter-instruction (cleavir-ir:enter-instruction)
((%owned-variables :initarg :owned-variables :reader owned-variables)))
(defun lexical-value (lexical-variable process)
(loop for table in (static-env (stack process))
do (multiple-value-bind (value presen... | (cl:in-package #:sicl-extrinsic-hir-interpreter)
(defclass enter-instruction (cleavir-ir:enter-instruction)
((%owned-variables :initarg :owned-variables :reader owned-variables)))
(defun lexical-value (lexical-variable process)
(loop for table in (static-env (stack process))
do (multiple-value-bind (value presen... | Set the value of a lexical variable in the current process. | Set the value of a lexical variable in the current process.
| Common Lisp | bsd-2-clause | clasp-developers/SICL,clasp-developers/SICL,vtomole/SICL,clasp-developers/SICL,vtomole/SICL,vtomole/SICL,clasp-developers/SICL,vtomole/SICL |
1a65c3fc77b048db96c1e67e42da52f06690ee5f | Code/Cleavir/AST-to-HIR/compile-optimize-related-asts.lisp | Code/Cleavir/AST-to-HIR/compile-optimize-related-asts.lisp | (cl:in-package #:cleavir-ast-to-hir)
(defmethod compile-ast ((ast cleavir-ast:speed-ast) context)
(compile-ast (cleavir-ast:child-ast ast)
(clone-context context
:speed-value (cleavir-ast:value ast))))
| (cl:in-package #:cleavir-ast-to-hir)
(defmethod compile-ast ((ast cleavir-ast:speed-ast) context)
(compile-ast (cleavir-ast:child-ast ast)
(clone-context context
:speed-value (cleavir-ast:value ast))))
(defmethod compile-ast ((ast cleavir-ast:debug-ast) context)
(compile-ast (cleavir-ast:child-as... | Define method on COMPILE-AST specialized to DEBUG-AST. | Define method on COMPILE-AST specialized to DEBUG-AST.
| Common Lisp | bsd-2-clause | clasp-developers/SICL,vtomole/SICL,clasp-developers/SICL,vtomole/SICL,clasp-developers/SICL,vtomole/SICL,vtomole/SICL,clasp-developers/SICL |
f90926c98bcd05cc68e51a2c3cbc13b12d38f23e | Code/Cleavir/HIR-transformations/Simple-value-numbering/simple-value-numbering.lisp | Code/Cleavir/HIR-transformations/Simple-value-numbering/simple-value-numbering.lisp | (cl:in-package #:cleavir-simple-value-numbering)
;;; We attribute a unique number to each value designator. That way,
;;; we can keep the value designators in a partition sorted by the
;;; unique number which makes operations on partitions faster.
;;;
;;; This variable should be bound to some small integer at the
;;;... | (cl:in-package #:cleavir-simple-value-numbering)
;;; We attribute a unique number to each value designator. That way,
;;; we can keep the value designators in a partition sorted by the
;;; unique number which makes operations on partitions faster.
;;;
;;; This variable should be bound to some small integer at the
;;;... | Add a slot to the VALUE-DESIGNATOR class for unique number. | Add a slot to the VALUE-DESIGNATOR class for unique number.
| Common Lisp | bsd-2-clause | vtomole/SICL,clasp-developers/SICL,vtomole/SICL,clasp-developers/SICL,clasp-developers/SICL,clasp-developers/SICL,vtomole/SICL,vtomole/SICL |
bb58a3721c399f307f2cb9e9b48473877a91e56d | code/graphviz/view.lisp | code/graphviz/view.lisp | ;;;; © 2016-2019 Marco Heisig - license: GNU AGPLv3 -*- coding: utf-8 -*-
(in-package #:petalisp.graphviz)
(defparameter *graphviz-default-viewer*
(flet ((program-in-path-p (program)
(multiple-value-bind (out err exit-code)
(uiop:run-program
(list "which" program)
... | ;;;; © 2016-2019 Marco Heisig - license: GNU AGPLv3 -*- coding: utf-8 -*-
(in-package #:petalisp.graphviz)
(defparameter *graphviz-default-viewer*
(flet ((program-in-path-p (program)
(multiple-value-bind (out err exit-code)
(uiop:run-program
(list "which" program)
... | Set the margin of Graphviz graphs to zero. | Set the margin of Graphviz graphs to zero.
| Common Lisp | agpl-3.0 | marcoheisig/Petalisp,marcoheisig/Petalisp |
387e47bde6f6f4f899f8245ef7bf4e5d9e843be2 | src/posts.lisp | src/posts.lisp | (in-package :coleslaw)
(defclass post (content)
((title :initform nil :initarg :title :accessor post-title)
(author :initform nil :initarg :author :accessor post-author)
(format :initform nil :initarg :format :accessor post-format)))
(defmethod initialize-instance :after ((object post) &key)
(with-accessors... | (in-package :coleslaw)
(defclass post (content)
((title :initform nil :initarg :title :accessor post-title)
(author :initform nil :initarg :author :accessor post-author)
(format :initform nil :initarg :format :accessor post-format)))
(defmethod initialize-instance :after ((object post) &key)
(with-accessors... | Use OR to guard instead of IF. | Use OR to guard instead of IF. | Common Lisp | bsd-2-clause | Ferada/coleslaw,superjudge/coleslaw,kingcons/coleslaw,6x13/coleslaw,redline6561/coleslaw |
0b00b8747a362d8b82111724c2082f6be9fe0ed3 | Code/Conditionals/sicl-conditionals-support.asd | Code/Conditionals/sicl-conditionals-support.asd | ;;;; Copyright (c) 2008 - 2013
;;;;
;;;; Robert Strandh (robert.strandh@gmail.com)
;;;;
;;;; all rights reserved.
;;;;
;;;; Permission is hereby granted to use this software for any
;;;; purpose, including using, modifying, and redistributing it.
;;;;
;;;; The software is provided "as-is" with no warranty. The u... | ;;;; Copyright (c) 2008 - 2013
;;;;
;;;; Robert Strandh (robert.strandh@gmail.com)
;;;;
;;;; all rights reserved.
;;;;
;;;; Permission is hereby granted to use this software for any
;;;; purpose, including using, modifying, and redistributing it.
;;;;
;;;; The software is provided "as-is" with no warranty. The u... | Define ASDF system in package ASDF-USER. | Define ASDF system in package ASDF-USER.
| Common Lisp | bsd-2-clause | clasp-developers/SICL,vtomole/SICL,clasp-developers/SICL,clasp-developers/SICL,vtomole/SICL,vtomole/SICL,clasp-developers/SICL,vtomole/SICL |
bdabe4a6b2d42b4a45df541869a99453deff1e7e | Code/Backends/Extrinsic-HIR-compiler/load-files.lisp | Code/Backends/Extrinsic-HIR-compiler/load-files.lisp | (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 ... | Load conditional macros into target environment. | Load conditional macros into target environment.
| Common Lisp | bsd-2-clause | clasp-developers/SICL,clasp-developers/SICL,vtomole/SICL,vtomole/SICL,clasp-developers/SICL,vtomole/SICL,clasp-developers/SICL,vtomole/SICL |
b654bd07fbf2c314aa57bf761cf3ab6b6dd257aa | environment/transpiler/targets/php/core/apply.lisp | environment/transpiler/targets/php/core/apply.lisp | ;;;;; tré – Copyright (c) 2008–2013 Sven Michael Klose <pixel@copei.de>
(dont-obfuscate *lexicals* *lexical-id* function_exists call_user_func_array)
(defun apply (&rest lst)
(with (fun lst.
l (last .lst)
args (%nconc (butlast .lst) l.)
closure? (is... | ; tré – Copyright (c) 2008–2013,2015 Sven Michael Klose <pixel@copei.de>
(dont-obfuscate *lexicals* *lexical-id* function_exists call_user_func_array)
(defun apply (&rest lst)
(with (fun lst.
l (last .lst)
args (nconc (butlast .lst) l.)
closure? (is... | Use NCONC instead of %NCONC. | Use NCONC instead of %NCONC.
| Common Lisp | mit | SvenMichaelKlose/tre,SvenMichaelKlose/tre,SvenMichaelKlose/tre |
28dbbf8eb7681499eb86e11e20564f686aba1dc9 | Code/Compiler/constants.lisp | Code/Compiler/constants.lisp | (in-package #:sicl-global-environment)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Constant NIL.
(eval-when (:compile-toplevel :load-toplevel :execute)
(push (make-constant-variable-entry nil nil)
(constant-variables *global-environment*)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;... | (cl:in-package #:sicl-global-environment)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Constant NIL.
(eval-when (:compile-toplevel :load-toplevel :execute)
(push (make-constant-variable-entry nil nil)
(constant-variables *global-environment*)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;... | Use explicit package marker with IN-PACKAGE. | Use explicit package marker with IN-PACKAGE.
| Common Lisp | bsd-2-clause | vtomole/SICL,vtomole/SICL,clasp-developers/SICL,clasp-developers/SICL,clasp-developers/SICL,clasp-developers/SICL,vtomole/SICL,vtomole/SICL |
f33d3ec5b1cc175c019acf67fada4a3845ad3992 | Code/Cleavir/Generate-AST/cleavir-generate-ast.asd | Code/Cleavir/Generate-AST/cleavir-generate-ast.asd | (cl:in-package #:common-lisp-user)
(asdf:defsystem :cleavir-generate-ast
:depends-on (:cleavir-ast
:cleavir-primop
:cleavir-code-utilities
:cleavir-environment)
:serial t
:components
((:file "packages")
(:file "conditions")
(:file "check-special-form-syntax")
(:file "minimal-co... | (cl:in-package #:common-lisp-user)
(asdf:defsystem :cleavir-generate-ast
:depends-on (:cleavir-ast
:cleavir-primop
:cleavir-code-utilities
:cleavir-environment)
:serial t
:components
((:file "packages")
(:file "conditions")
(:file "check-special-form-syntax")
(:file "environmen... | Add locally defined environment query functions as component. | Add locally defined environment query functions as component.
| Common Lisp | bsd-2-clause | vtomole/SICL,vtomole/SICL,clasp-developers/SICL,clasp-developers/SICL,vtomole/SICL,clasp-developers/SICL,clasp-developers/SICL,vtomole/SICL |
f9bf550fbe60dc557ccb9a948f490b9b146d5267 | Code/Compiler/Extrinsic-environment/traced-funcall.lisp | Code/Compiler/Extrinsic-environment/traced-funcall.lisp | (cl:in-package #:sicl-extrinsic-environment)
(defparameter *trace-funcall* nil)
(defparameter *depth* 0)
(defun traced-funcall (environment function &rest arguments)
(if *trace-funcall*
(let* ((entries (sicl-simple-environment::function-entries environment))
(entry (block nil
(maphash
... | (cl:in-package #:sicl-extrinsic-environment)
(defparameter *trace-funcall* nil)
(defparameter *depth* 0)
(defun traced-funcall (environment function &rest arguments)
(if *trace-funcall*
(let ((name (or (car (sicl-genv:function-names function environment))
"???"))
(result nil))
(loop repeat *dep... | Use new environment function to find function name in trace. | Use new environment function to find function name in trace.
| Common Lisp | bsd-2-clause | clasp-developers/SICL,vtomole/SICL,clasp-developers/SICL,vtomole/SICL,vtomole/SICL,clasp-developers/SICL,clasp-developers/SICL,vtomole/SICL |
88cc713983572cbd5fdf8d83ec58d77a799813e3 | split-sequence.asd | split-sequence.asd | ;;; -*- Lisp -*-
(defsystem :split-sequence
:author "Arthur Lemmens <alemmens@xs4all.nl>"
:maintainer "Sharp Lispers <sharplispers@googlegroups.com>"
:description "Splits a sequence into a list of subsequences
delimited by objects satisfying a test."
:license "MIT"
:version (:read-file-form "version.sexp")... | ;;; -*- Lisp -*-
#.(unless (or #+asdf3.1 (version<= "3.1" (asdf-version)))
(error "You need ASDF >= 3.1 to load this system correctly."))
(defsystem :split-sequence
:author "Arthur Lemmens <alemmens@xs4all.nl>"
:maintainer "Sharp Lispers <sharplispers@googlegroups.com>"
:description "Splits a sequence into ... | Add ASDF guard to the .asd file | Add ASDF guard to the .asd file
| Common Lisp | mit | sharplispers/split-sequence |
42684ebcbbd16f2683f215f65136d069ac7a992a | Code/Cleavir/Def-use-chains/cleavir-def-use-chains-test.asd | Code/Cleavir/Def-use-chains/cleavir-def-use-chains-test.asd | (cl:in-package #:asdf-user)
(defsystem :cleavir-def-use-chains-test
:depends-on (:cleavir-def-use-chains
:cleavir-test-utilities)
:components
((:file "test-packages")
(:file "test-def-use-chains" :depends-on ("test-packages"))))
| (cl:in-package #:asdf-user)
(defsystem :cleavir-def-use-chains-test
:depends-on (:cleavir-def-use-chains
:cleavir-test-utilities)
:serial t
:components
((:file "test-packages")
(:file "test-def-use-chains")))
| Use option :SERIAL T to simplify system. | Use option :SERIAL T to simplify system.
| Common Lisp | bsd-2-clause | vtomole/SICL,clasp-developers/SICL,vtomole/SICL,clasp-developers/SICL,vtomole/SICL,vtomole/SICL,clasp-developers/SICL,clasp-developers/SICL |
fc571fc07ce26bf272c7b2cf098e3ee228f49389 | Binary-tree/docstrings-english.lisp | Binary-tree/docstrings-english.lisp | (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... | Add English documentation for function (SETF LEFT). | Add English documentation for function (SETF LEFT).
| Common Lisp | bsd-2-clause | robert-strandh/Clump |
491c3f44eaeb732dc5741fbcac0cdda12b0841f8 | Code/Cleavir/Register-allocation/cleavir-register-allocation.asd | Code/Cleavir/Register-allocation/cleavir-register-allocation.asd | (cl:in-package #:common-lisp-user)
(asdf:defsystem :cleavir-register-allocation
:depends-on (:cleavir-liveness
:cleavir-ir
:cleavir-hir
:cleavir-mir)
:components
((:file "packages")
(:file "compute-conflicts")
(:file "graph-coloring")))
| (cl:in-package #:asdf-user)
(defsystem :cleavir-register-allocation
:depends-on (:cleavir-liveness
:cleavir-ir
:cleavir-hir
:cleavir-mir)
:components
((:file "packages")
(:file "compute-conflicts")
(:file "graph-coloring")))
| Define system in package ASDF-USER. | Define system in package ASDF-USER.
| Common Lisp | bsd-2-clause | clasp-developers/SICL,vtomole/SICL,vtomole/SICL,clasp-developers/SICL,vtomole/SICL,clasp-developers/SICL,clasp-developers/SICL,vtomole/SICL |
7399c6a65020066e308c9457d8ccac50ce00065c | Code/Cleavir/Backends/HIR-interpreter/cleavir-hir-interpreter.asd | Code/Cleavir/Backends/HIR-interpreter/cleavir-hir-interpreter.asd | (cl:in-package #:common-lisp-user)
(asdf:defsystem :cleavir-hir-interpreter
:depends-on (:cleavir-hir
:cleavir-hir-transformations
:cleavir-basic-blocks)
:serial t
:components
((:file "packages")
(:file "translate")))
| (cl:in-package #:asdf-user)
(defsystem :cleavir-hir-interpreter
:depends-on (:cleavir-hir
:cleavir-hir-transformations
:cleavir-basic-blocks)
:serial t
:components
((:file "packages")
(:file "translate")))
| Define system in package ASDF-USER. | Define system in package ASDF-USER.
| Common Lisp | bsd-2-clause | clasp-developers/SICL,clasp-developers/SICL,vtomole/SICL,clasp-developers/SICL,vtomole/SICL,clasp-developers/SICL,vtomole/SICL,vtomole/SICL |
a801ca30cbe2fad652e881ec0983aad5c3668eb5 | Code/CLOS/simple-method-combination-defclass.lisp | Code/CLOS/simple-method-combination-defclass.lisp | (cl:in-package #:sicl-clos)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Class SIMPLE-METHOD-COMBINATION.
(defclass simple-method-combination (method-combination)
((%operation :initarg :operation :reader operation)))
| ;;;; Copyright (c) 2010 - 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 copyright dates and license statement. | Add copyright dates and license statement.
| Common Lisp | bsd-2-clause | clasp-developers/SICL,vtomole/SICL,vtomole/SICL,clasp-developers/SICL,vtomole/SICL,vtomole/SICL,clasp-developers/SICL,clasp-developers/SICL |
1df20466739bf94bd87d71d83929f716dc4cc7b6 | Lisp-Dep/fix-clisp.lisp | Lisp-Dep/fix-clisp.lisp | (defpackage #:clim-mop
(:use #:clos))
(eval-when (:compile-toplevel :load-toplevel :execute)
(loop for sym being the symbols of :clim-mop
do (export sym :clim-mop)))
;; CLIM expects INPUT-STREAM-P to be a generic function.
(unless (typep #'input-stream-p 'generic-function)
(setf (fdefinition 'gray::origina... | Package setup and misc fixes for running on CLISP. | Package setup and misc fixes for running on CLISP.
| Common Lisp | lgpl-2.1 | quek/mcclim,informatimago/mcclim,quek/mcclim,informatimago/mcclim | |
97d232b2ffbe4321937234e243611d2afe16b4fa | tests/compiler/codegen/syntax.lisp | tests/compiler/codegen/syntax.lisp | (import extra/test ())
(import extra/assert ())
(import tests/compiler/codegen/codegen-helpers ())
(describe "The codegen will generate syntactically valid Lua for"
(section "symbols that are"
(it "empty"
(affirm-codegen
~((define ,(string->symbol "") 2))
"_e = 2"))
(pending "numbers"
... | Add a couple of failign tests for codegen | Add a couple of failign tests for codegen
| Common Lisp | bsd-3-clause | SquidDev/urn,SquidDev/urn | |
98a673b03de6e3d2d81bb92bac96a9539fe4eb40 | cqlcl-conn.lisp | cqlcl-conn.lisp | (in-package :cqlcl)
(defclass connection ()
((streams :accessor streams)
(version :accessor vsn)))
(defclass cql-stream ()
((id :accessor id :initarg id)))
| Add skeleton for the connection module | Add skeleton for the connection module
| Common Lisp | bsd-2-clause | AeroNotix/cqlcl | |
0ba4daa98b7b424a39e57d486e18ccfa72cbf675 | test/packages.lisp | test/packages.lisp | (cl:defpackage :csv-filter-test
(:use :cl :csv-filter :rt)
(:import-from :rt #:*expected-failures*) )
(rt:rem-all-tests)
| Add some skelton of test suite | Add some skelton of test suite
| Common Lisp | mit | ichimal/csv-filter | |
1f4d2df78528a253441d3e786f1a7953be835a17 | test/surprise.lisp | test/surprise.lisp | (defun eval. (e a)
(cond
((atom e) (assoc. e a))
((atom (car e))
(cond
((eq (car e) 'quote) (cadr e))
((eq (car e) 'atom) (atom (eval. (cadr e) a)))
((eq (car e) 'eq) (eq (eval. (cadr e) a)
(eval. (caddr e) a)))
((eq (car e) 'car) ... | Copy "Surprise" from The Roots of Lisp | Copy "Surprise" from The Roots of Lisp
Signed-off-by: Pekka Enberg <add4fcd06328a394f0ad91feda7ee057316dc5ed@kernel.org>
| Common Lisp | mit | vpeurala/huron,vpeurala/huron,vpeurala/huron | |
967f33352f1512ca87b31f34252bfb493ab8b79e | src/main/lsp/impl/common-impl-type.lisp | src/main/lsp/impl/common-impl-type.lisp | ;; common-impl-type.lisp - Implementation Support for Type Sys. Reflection, SBCL
;;------------------------------------------------------------------------------
;;
;; Copyright (c) 2014-2019 Sean Champ and others. All rights reserved.
;;
;; This program and the accompanying materials are made available under the
;; te... | Add an initial implementation of a naive TYPE-DEFINED-P (SBCL) | Add an initial implementation of a naive TYPE-DEFINED-P (SBCL)
| Common Lisp | epl-1.0 | MetaCommunity/mci-cltl-utils | |
ef292c4b63bf4df56563860357e53cc2f8dbacae | Problem009/CommonLisp/solution_1.lisp | Problem009/CommonLisp/solution_1.lisp | ;; Common Lisp Script
;; Manoel Vilela
(defun pythagorean (a b c)
(= (+ (* a a)
(* b b))
(* c c)))
(defun solution()
(loop for a from 1 to 998 do
(loop for b from a to 998 do
(loop for c from b to 998
when (and (= 1000 (+ a b c))
(pythagorean a b c))
... | Add solution for Problem009 written in Common Lisp | Add solution for Problem009 written in Common Lisp
| Common Lisp | mit | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectE... | |
1605e671684bc922fb7ed680ea412435332aa6d6 | tests/streamlets-tests.asd | tests/streamlets-tests.asd | ;;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
;;;; Copyright (C) 2014 Varoun. P
;;;; This program is free software: you can redistribute it and/or modify
;;;; it under the terms of the GNU Affero General Public License as
;;;; published by the Free Software Foundation, eith... | Create system definition file for streamlets tests. | Create system definition file for streamlets tests.
| Common Lisp | agpl-3.0 | streamlets/streamlets,streamlets/cl-streamlets | |
997a7a8f1bd29658df2224211654f6b539cb3e87 | Problem006/CommonLisp/solution_1.lisp | Problem006/CommonLisp/solution_1.lisp | ;; Common Lisp Script
;; Manoel Vilela
(defun square (x)
(* x x))
;; (1 2 3) => 1² + 2² + 3² => 14
(defun square-sum (list)
(reduce #'+ (mapcar #'square
list)))
;; (1 2 3) => (1 + 2 + 3)² => 6² => 36
(defun sum-square (list)
(square (reduce #'+ list)))
(defun solution(n)
(let ((numbers... | Add solution for Problem006 written in Common Lisp | Add solution for Problem006 written in Common Lisp
| Common Lisp | mit | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectE... | |
690aa2909543471fd6e91c24993479355f40e933 | Problem063/CommonLisp/solution_1.lisp | Problem063/CommonLisp/solution_1.lisp | (defun range (n)
(loop for x from 1 to n collect x))
(defun ilength (n)
(length (write-to-string n)))
(defun solution()
(loop
for a in (range 9)
for tries = (loop
for n in (range 21)
for x = (expt a n)
when (= (ilength x) n)
... | Add solution for Problem063 written in Common Lisp | Add solution for Problem063 written in Common Lisp
| Common Lisp | mit | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectE... | |
91b76cd485230278e386d5d3aaf33b966bee62a5 | src/tls/transport.lisp | src/tls/transport.lisp | ;; Some parts of tls require an implementation to perform
;; http, ldap, or other kind of network-based communication.
;; Defined here are classes and methods to be specialized to
;; provide such service
(in-package :cl-tls)
(defclass address ()
((host :initarg :host
:accessor host)
(port :initarg :port
:acce... | Add class and method for sockets | Add class and method for sockets
| Common Lisp | bsd-3-clause | shrdlu68/cl-tls | |
cd9c5b2fd5ef2141469e2634461f3044ee2352c5 | tests.lisp | tests.lisp | #!./interpreter.py
(set! testsFailed 0)
(set! testsSuccess 0)
(set! should
(lambda (assertion msg)
(if assertion
(set! testsSuccess (+ testsSuccess 1))
(begin
(display (+ "Test failed : " msg))
(set! testsFailed (+ testsFailed 1))
)
)
)
)
(set! shouldEqual
(lam... | Add a simple test suite in lisp | Add a simple test suite in lisp
| Common Lisp | mit | antoinealb/lis.py,antoinealb/lis.py | |
58b4ef9849e6cd002f2e9a9e9a9b4a1e0391c2cb | land-of-lisp/cap5-building-a-text-game-engine.lisp | land-of-lisp/cap5-building-a-text-game-engine.lisp | ;; Common Lisp Script
;; Manoel Vilela
(defparameter *nodes* '((living-room (you are in the living-room.
a wizard is snoring loudly on the couch.))
(garden (you are in a beatiful garden.
there is a well in front of you.))
... | Add inital code about text game engine on cap5 | Add inital code about text game engine on cap5
| Common Lisp | mit | limbocode/lisp-insights,ryukinix/lisp-insights | |
c35b7683abf7b5809605718c3d79006b89359983 | example-1.lisp | example-1.lisp | ;; $Id: example-1.lisp,v 1.1 2006-08-11 12:52:53 alemmens Exp $
(in-package :test-rucksack)
;; NOTE: This example doesn't run at the moment, because indexing doesn't
;; work correctly yet.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Indexing, class redefinitions
;;;;;;;;;;;;;;... | Add indexing example (doesn't work yet). | Add indexing example (doesn't work yet).
| Common Lisp | mit | quek/rucksack-mmap | |
23311a575032994e74a3959cba27a9b4c3c02f6b | lisp/set1.lisp | lisp/set1.lisp | (ql:quickload '(:arrow-macros :s-base64))
(use-package :arrow-macros)
(defvar *s1c1-hex* "49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d")
(defvar *s1c1-base64* "SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t")
(defun bytes->string (bytes)
"Takes a... | Set 1, Challenge 1 in Lisp | Set 1, Challenge 1 in Lisp
| Common Lisp | mit | gwbrown/cryptopals | |
c286fc1e337c03b246b960b58f236c9bd8cef03d | tests/plugins/twitter-summary-card.lisp | tests/plugins/twitter-summary-card.lisp | (stefil:define-test-package :twitter-summary-card-tests
(:use :cl :coleslaw
:cl-ppcre))
(in-package :twitter-summary-card-tests)
;;;;
;; To run tests first eval the plugin code inside this package and then execute
;; (twitter-summary-card-test:run-package-tests)
;;;
(defvar *short-post*
(make-ins... | Add tests as a PoC. Do not for merge. | Add tests as a PoC. Do not for merge.
| Common Lisp | bsd-2-clause | kingcons/coleslaw,Ferada/coleslaw,6x13/coleslaw,superjudge/coleslaw,redline6561/coleslaw | |
787bdd9dd70b29f70ab3178a0224787d36ef1e53 | strings.lisp | strings.lisp | ;;;; strings.lisp
(in-package #:cryptopals)
(defconstant +ascii-hex+ '((#\0 . #x0) (#\1 . #x1) (#\2 . #x2) (#\3 . #x3)
(#\4 . #x4) (#\5 . #x5) (#\6 . #x6) (#\7 . #x7)
(#\8 . #x8) (#\9 . #x9) (#\a . #xa) (#\b . #xb)
(#\c . #xc) (#\... | Implement hex string to bytes | Implement hex string to bytes
| Common Lisp | mit | jdtw/cryptopals | |
263eff0bdab74ebd2e817bd4deda3d84d3061615 | environment/transpiler/targets/php/environment/late-symbol.lisp | environment/transpiler/targets/php/environment/late-symbol.lisp | ;;;;; Transpiler: TRE to JavaScript
;;;;; Copyright (c) 2008-2010 Sven Klose <pixel@copei.de>
;; Make symbol in particular package.
(defun make-symbol (x &optional (pkg nil))
(new __symbol x pkg))
;; Make package (which is just a symbol).
(defun make-package (x)
(new __symbol x nil))
(defvar *keyword-package* (m... | ;;;;; Transpiler: TRE to JavaScript
;;;;; Copyright (c) 2008-2010 Sven Klose <pixel@copei.de>
;; Make symbol in particular package.
(defun make-symbol (x &optional (pkg nil))
(new __symbol x pkg))
;; Make package (which is just a symbol).
(defun make-package (x)
(new __symbol x nil))
(defvar *keyword-package* (m... | Return correct names for T and NIL which aren't real symbol objects. | SYMBOL-NAME: Return correct names for T and NIL which aren't real symbol objects.
| Common Lisp | mit | SvenMichaelKlose/tre,SvenMichaelKlose/tre,SvenMichaelKlose/tre |
924207516721719fd2d4d504d8e115069c043a78 | src/main/cltl/testkit/eval-proto.lisp | src/main/cltl/testkit/eval-proto.lisp |
(defmacro eval-when-test ((&rest specifers) &body body
&enviroment environment)
)
;; TBD:
;; - Test Specifiers - Syntax and Application Behaviors
;; - Test Naming
;; - Test Grouping
;; - Test Evaluation Constraints
;; - Code Evaluation Phase (onto ANSI CL vis.... | Add prototype from 15 November 2017 - [SYCAMOPE] wkspace | Add prototype from 15 November 2017 - [SYCAMOPE] wkspace
| Common Lisp | epl-1.0 | MetaCommunity/mci-cltl-utils | |
9d36911fe209e30aa7df0a3a17a652ca91538383 | samples/func-ptr.lisp | samples/func-ptr.lisp | (declare
(newline (ascii "\n"))
(double (function integer integer))
(triple (function integer integer))
(do-42 (function integer
(func-pointer integer integer)))
(main (function byte)))
(define double (x)
(declare)
(return (* x 2)))
(define triple (x)
(declare)
(return (* x 3)))
(define do-42 (fun... | Add a sample for function pointers | Add a sample for function pointers
| Common Lisp | mit | adamnew123456/spc,adamnew123456/spc | |
18bb9a23c3a921241ffcffeeb0fffe6b945cd269 | Documentation/Manual/LaTeX/ex3.lisp | Documentation/Manual/LaTeX/ex3.lisp | (in-package :common-lisp-user)
(defpackage :app
(:use :clim :clim-lisp)
(:export #:app-main))
(in-package :app)
(define-application-frame superapp ()
()
(:pointer-documentation t)
(:panes
(app :application :display-time t :height 300 :width 600)
(int :interactor :height 200 :width 600))
(:layouts... | Include example of use of presentation types. | Include example of use of presentation types.
| Common Lisp | lgpl-2.1 | onixie/mcclim,slyrus/mcclim,onixie/mcclim,slyrus/mcclim,onixie/mcclim | |
50debff5fb3471bfcfaad60bf825d8bb0f63ed3d | Problem002/CommonLisp/solution_1.lisp | Problem002/CommonLisp/solution_1.lisp | ;; Common Lisp Script
;; Manoel Vilela
(defun fib (n)
(labels ((tail-fib (n a b)
(if (= n 0)
a
(tail-fib (1- n)
b
(+ a b)))))
(tail-fib n 0 1)))
(defun solution ()
(format t "~a~%" (loop for x from 0
... | Add solution for Problem002 written in Common Lisp | Add solution for Problem002 written in Common Lisp
| Common Lisp | mit | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectE... | |
2c72e4e7a096ccde55a31039b74c9ab309eb16ad | Problem004/CommonLisp/solution_1.lisp | Problem004/CommonLisp/solution_1.lisp | ;; Common Lisp Script
;; Manoel Vilela
(defun reverse-digits (n)
(labels ((next (n v)
(if (zerop n)
v
(multiple-value-bind (q r)
(truncate n 10)
(next q (+ (* v 10) r))))))
(next n 0)))
(defun palindromep (n)
(= n (reverse-... | Add solution for Problem004 written in Common Lisp | Add solution for Problem004 written in Common Lisp
| Common Lisp | mit | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectE... | |
37be2194575220a0cd9faf058dc0514dac69fb8c | samples/jagged-struct.lisp | samples/jagged-struct.lisp | (declare
(jagged (struct (a integer)
(b byte)))
(takes-jagged (function byte jagged))
(requires-right-alignment (function integer integer))
(main (function byte)))
(define takes-jagged (jagged)
(declare)
(block))
(define requires-right-alignment (a)
(declare)
(block
(return a)))
(define m... | Add sample for jagged structs | Add sample for jagged structs
I had a vague idea that jagged struct parameters might pose an issue, this
test is just to confirm that.
| Common Lisp | mit | adamnew123456/spc,adamnew123456/spc | |
0a872bf2d1096ef30ddadb5f56b2611e6a576de7 | examples/ten-times.lisp | examples/ten-times.lisp | (defun function1 (state environment)
(if (>= state 40)
(cons 0 0)
(cons (+ 1 state) (/ state 10))))
(cons 0 function1)
| Add a simple LambdaMan program that moves 10 squares | Add a simple LambdaMan program that moves 10 squares
| Common Lisp | apache-2.0 | alexrudnick/icfp2014,alexrudnick/icfp2014,alexrudnick/icfp2014,alexrudnick/icfp2014 | |
db8edb168797d98b7b37cecd85adb6447406adf2 | unit-tests.lisp | unit-tests.lisp | ;;;; unit-tests.lisp
;;;; Author: Elliot Penson
(in-package :knight-owl)
(ql:quickload "fiveam")
(use-package :fiveam)
(def-suite knight-owl-suite)
(in-suite knight-owl-suite)
(test file->index
(is (= (file->index #\a) 0))
(is (= (file->index #\b) 1))
(is (= (file->index #\c) 2))
(is (= (file->index #\d) 3)... | Add unit tests for three board functions | Add unit tests for three board functions
| Common Lisp | mit | ElliotPenson/knight-owl | |
43d5299f4402682616f79ea4510d46894b306ce4 | code/ir/partitioning.lisp | code/ir/partitioning.lisp | ;;;; © 2016-2020 Marco Heisig - license: GNU AGPLv3 -*- coding: utf-8 -*-
(in-package #:petalisp.ir)
;;; In this file, we partition each kernel into tasks. We do this by first
;;; computing the optimal dimensions of a task, and then cut the domain
;;; into tasks that are at most as large as that.
(defgeneri... | Add a function for computing the optimal dimensions of a task. | Add a function for computing the optimal dimensions of a task.
| Common Lisp | agpl-3.0 | marcoheisig/Petalisp,marcoheisig/Petalisp | |
afcfb56f824b60207731e3631d354b434276fcbf | tests/test-ring.lisp | tests/test-ring.lisp | (defpackage :next.tests
(:use :common-lisp
:next
:prove))
(in-package :next.tests)
(plan nil)
(defvar test-ring1 (make-instance 'next::ring))
(loop for i from 1 to 1000
do (next::ring-insert test-ring1 (make-string i :initial-element #/a)))
(subtest "Add 1000 items, test head-index, item-count, ... | Add some tests for ring class. | Add some tests for ring class.
| Common Lisp | bsd-3-clause | jmercouris/NeXT,jmercouris/NeXT | |
d0ba06d8cb749621cee30fb0c691d9ac018c31b3 | rplugin/lisp/lisp-interface.lisp | rplugin/lisp/lisp-interface.lisp | (in-package :cl-user)
(ql:quickload :arrow-macros)
(defpackage #:lisp-interface
(:use #:cl #:cl-neovim #:arrow-macros)
(:shadowing-import-from #:cl #:defun #:eval))
(in-package :lisp-interface)
(nvim:defcommand/s lisp (&rest form)
(declare (opts nargs))
(let ((output (with-output-to-string (*standard-output*)... | Add :Lisp command (lisp equivalent of :python) | Add :Lisp command (lisp equivalent of :python)
| Common Lisp | mit | adolenc/cl-neovim,adolenc/cl-neovim | |
43ffe8cb05b51444548b8d2d0fdc160d8a987a34 | chess.lisp | chess.lisp | ;;;; chess.lisp
;;;; Author: Elliot Penson
(in-package :knight-owl)
(defconstant +number-of-files+ 8)
(defconstant +number-of-ranks+ 8)
(defconstant +initial-board+
#2A((b-r b-n b-b b-q b-k b-b b-n b-r)
(b-p b-p b-p b-p b-p b-p b-p b-p)
(nil nil nil nil nil nil nil nil)
(nil nil nil nil nil nil ... | Include basic board representation and interaction | Include basic board representation and interaction
| Common Lisp | mit | ElliotPenson/knight-owl | |
db464650d0df260a82731b8a08f6eb83a8d7ee37 | lispos.asd | lispos.asd | (in-package :asdf)
(defsystem "lispos"
:description "Lisp operating system."
:version "0"
:author "Henry Harrington <henry.harrington@gmail.com>"
:licence "None"
:components ((:file "build-unicode")
(:file "lap")
(:file "lap-x86" :depends-on ("lap"))
(:file "genes... | Add an ASDF system definition! | Add an ASDF system definition!
| Common Lisp | mit | varjagg/Mezzano,rvedam/Mezzano,varjagg/Mezzano,AugustusHuang/Mezzano,rvedam/Mezzano,froggey/Mezzano,froggey/Mezzano,AugustusHuang/Mezzano | |
831d6ca4d02671142e452b078b98466dd8fa240b | qsort.lisp | qsort.lisp | (defun qsort (l)
(print l)
(cond
((null l) nil)
((= (length l) 1) l)
(T
(setq l1
(qsort
(remove-if-not
(lambda (x) (> (first l) x))
(rest l))))
(setq l2
(qsort
(remove-if
(lambda (x) (> (first l) x))
(rest l)... | Add a broken lisp quicksort | Add a broken lisp quicksort
| Common Lisp | unlicense | porglezomp/learn-languages,porglezomp/learn-languages,porglezomp/learn-languages,porglezomp/learn-languages,porglezomp/learn-languages,porglezomp/learn-languages | |
fa2ef3c6cacfc2272c9a0da4141ebf60cc398a5d | mit-6.001/lambda-expressions.lisp | mit-6.001/lambda-expressions.lisp | ;; 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(... | Add material about lambda expressions | Add material about lambda expressions
| Common Lisp | mit | ryukinix/lisp-insights,limbocode/lisp-insights | |
7ac77874902fd22e4c8dcf96fa65135ce03a6df1 | Problem097/CommonLisp/solution_1.lisp | Problem097/CommonLisp/solution_1.lisp | ;; Common Lisp Script
;; Manoel Vilela
(format t "~a~%" (mod (+ 1 (* 28433 (expt 2 7830457)))
(expt 10 10)))
| Add solution for Problem097 written in Common Lisp | Add solution for Problem097 written in Common Lisp
Seems SBCL make some internals optimizations for A^B mod C. The whole
evaluation takes only 0.08s.
| Common Lisp | mit | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectE... | |
320319fd59714cf7d100af789ff4d0febd64a697 | Problem003/CommonLisp/solution_1.lisp | Problem003/CommonLisp/solution_1.lisp | ;; Common Lisp Script
;; Manoel Vilela
(defun factors (n)
"Return a list of '(prime factor) for n
(factors 100) => ((2 2) (5 2))
"
(loop for x from 2
while (> n 1)
when (= 0 (mod n x))
collect (loop for c from 0
while (= 0 (mod n x))
do... | Add solution for Problem003 written in Common Lisp | Add solution for Problem003 written in Common Lisp
| Common Lisp | mit | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectE... | |
c679bcb9403b690682bffb8581ee6f6eca90a011 | gaussian-integers.lisp | gaussian-integers.lisp | (in-package :cl-user)
(defpackage :gaussian-integers
(:use :cl))
(in-package :gaussian-integers)
(defun print-g-int (g-int)
(format nil "(~A+~A)i" (car g-int) (cadr g-int)))
(defun add-g-ints (&rest g-ints)
(funcall #'apply-g-int-operation #'+ g-ints))
(defun subtract-g-ints (&rest g-ints)
(funcall #'apply-... | Add rudimentary gaussina integer support | Add rudimentary gaussina integer support
| Common Lisp | mit | rudolfochrist/programming-praxis | |
8d9fd471da41181c30c838f484a72c8ce10f3fa5 | lib/do.lisp | lib/do.lisp | (import base (clock))
(import string (#s sub))
(defmacro do (&statements)
(letrec [(name (gensym))
(unfold
(lambda (stmt)
(let* [(hd (car stmt))
(stmt (cdr stmt))]
(cond
[(eq? hd 'for)
(let* [(var (nt... | Add list comprehensions to the standard library | Add list comprehensions to the standard library
| Common Lisp | bsd-3-clause | SquidDev/urn,SquidDev/urn | |
5aa54122d08bf19a7a36a78d56aeb29db8623d3a | regression_testing.lisp | regression_testing.lisp | #!./interpreter.py
(require "unittest.lisp")
; Some simple sanity tests
(shouldEqual 4 (+ 1 3) "Adding two numbers")
(shouldEqual 4 (car (list 4 3 2)) "Taking the head of a list")
(shouldEqual (list 3 2) (cdr (list 4 3 2)) "Taking the tail of a list")
; Some lambda test
(set! increment (lambda (x) (+ x 1)))
(shouldEq... | Add a regression test script | Add a regression test script
| Common Lisp | mit | antoinealb/lis.py,antoinealb/lis.py | |
333ddb226dfd6bf4fd801e14e95afa2ee0c84df8 | random/namespaces-troll.lisp | random/namespaces-troll.lisp | ;; Common Lisp Script
;; Manoel Vilela
(flet ((foo (when funcall)
(when (< 3 when)
(funcall funcall)) when))
(loop :named funcall :for funcall :from 1 :collect
(foo funcall (lambda () (loop-finish))))) | Add a cool troll code about multiple namespaces | Add a cool troll code about multiple namespaces
| Common Lisp | mit | limbocode/lisp-insights,ryukinix/lisp-insights | |
38d594e90b7ad4e0c330b7c3e54bf6101e362fac | Problem001/CommonLisp/solution_1.lisp | Problem001/CommonLisp/solution_1.lisp | ;; Common Lisp version
;; Manoel Vilela
(defun div (x d)
(= (mod x d) 0))
(defun special-sum (n)
(reduce '+ (loop for x from 1 to n when (or (div x 5) (div x 3)) collect x)))
(format t "~d" (special-sum 1000))
| Add Common Lisp solution for Problem001 | Add Common Lisp solution for Problem001
Some weird here... the answer is wrong, LOL. But the code
is so simple that I don't understand... The solution return a value
with error of +100.
| Common Lisp | mit | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectE... | |
feec8a4330e59d018bd9e30aacc64c5629e0005e | Problem056/CommonLisp/solution_1.lisp | Problem056/CommonLisp/solution_1.lisp | ;; Common Lisp Script
;; Manoel Vilela
(defun sum-digits (number &optional (base 10))
(loop for n = number then q
for (q r) = (multiple-value-list (truncate n base))
sum r until (zerop q)))
(defun solution ()
(loop for a from 1 to 100
maximize (loop for b from 1 to 100
... | Add solution for Problem056 written in Common Lisp | Add solution for Problem056 written in Common Lisp
| Common Lisp | mit | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectE... | |
1739523e2fedd5fe40f3597f362bb2e274244ffe | Problem010/CommonLisp/solution_1.lisp | Problem010/CommonLisp/solution_1.lisp | ;; Common Lisp Script
;; Manoel Vilela
(defun primep (n)
(let ((divisors (loop for x from 2 to (floor (1+ (sqrt n)))
collect x)))
(loop for d in divisors
never (and (= (mod n d) 0)
(not (= n d))))))
(defun solution (limit)
(loop for x from 2
for ... | Add solution for Problem010 written in Common Lisp | Add solution for Problem010 written in Common Lisp
| Common Lisp | mit | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectE... | |
50b14ee0b5afa749a94bc19685f161b8908ac446 | random/command-line-args.lisp | random/command-line-args.lisp | #!/usr/bin/sbcl
;; Common Lisp Script
;; Manoel Vilela
(defun my-command-line ()
(or
#+SBCL sb-ext:*posix-argv*
#+CLISP *args*
#+LISPWORKS system:*line-arguments-list*
#+CMU extensions:*command-line-words*
nil))
(format t "~&~S~&" (my-command-line)) | Add tricks about dealing with command line args (argv) | Add tricks about dealing with command line args (argv)
| Common Lisp | mit | ryukinix/lisp-insights,limbocode/lisp-insights | |
571271647f94dbf19955283abc65f79cbc4315a5 | run-tests.lisp | run-tests.lisp | ;After setting up quicklisp, run this file in clisp to run the test suite.
(load "~/.clisprc.lisp")
(ql:quickload "magician")
(ql:quickload "magician-test")
| Add a lisp script that runs the tests | Add a lisp script that runs the tests
| Common Lisp | mit | nicolasmccurdy/magician-lisp,nicolasmccurdy/magician-lisp,nicolasmccurdy/magician-clojure,nicolasmccurdy/magician-clojure | |
5f2796cb0e0e8c9b60c8793eae06714ba988e4c6 | autograph.lisp | autograph.lisp | (require :cl-ppcre)
(require :anaphora)
(use-package :anaphora)
;; Encode a js symbol, graciously stolen from from Parenscript
(let ((cache (make-hash-table :test 'equal)))
(defun encode-js-identifier (identifier)
"Given a string, produces to a valid JavaScript identifier by
following transformation heuristics c... | Add Parenscript symbol encoding routine. | Add Parenscript symbol encoding routine.
| Common Lisp | bsd-3-clause | burtonsamograd/autograph,burtonsamograd/autograph | |
69785a9045c10dced457a54e7b27a91ea55263f9 | mit-6.001/heuristic-square-root.lisp | mit-6.001/heuristic-square-root.lisp | ;; Common Lisp Script
;; Manoel Vilela
#| A heuristic method to calculate the
square root of a number x based on the
Hero of Alexandria's alogrithm.
|#
(defparameter *error-limit* 0.001)
(defparameter *tests* '((square-root 2)
(square-root 12)
(square-root 2... | Add heuristic square-root algorithm in Common Lisp | Add heuristic square-root algorithm in Common Lisp
The algoritm is based on MIT 6.0001 lectures about Lisp
on course Structures and Interpretations at '86.
| Common Lisp | mit | ryukinix/lisp-insights,limbocode/lisp-insights | |
348dec0bf8fcd1cf0916e9e1d87651167bf6c350 | Problem020/CommonLisp/solution_1.lisp | Problem020/CommonLisp/solution_1.lisp | ;; Common Lisp Script
;; Manoel Vilela
(defun integer-to-list (x)
(if (< x 10)
(cons x nil)
(cons (mod x 10)
(integer-to-list (floor (/ x 10))))))
(defun sum (the-list)
(reduce '+ the-list))
(defun fat (x)
(if (<= x 2)
x
(* x (fat (1- x)))))
(defun solution ()
(sum (int... | Add CommonLisp solution based at 16 solution | [P020] Add CommonLisp solution based at 16 solution
| Common Lisp | mit | DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectEuler,DestructHub/ProjectE... | |
893da5c93aac4d37d0d1da6823e7a4db89ae8c36 | plugins/fold-defgeneric.lisp | plugins/fold-defgeneric.lisp | (import compiler/pass ())
(import compiler/nodes ())
(import lua/basic (set-idx!))
(defun get-lookup (lookup key)
:hidden
(with (len (n lookup))
(loop [(i 2)]
[(> i len)
(with (sub (list (fix-symbol `struct-literal)))
(push-cdr! lookup key)
(push-cdr! lookup sub)
sub)]
... | Add a small plugin to fold defmethod/defdefaults | Add a small plugin to fold defmethod/defdefaults
This helps keep the definition in one place, and so the optimiser can
strip the definition if needed.
| Common Lisp | bsd-3-clause | SquidDev/urn,SquidDev/urn | |
8410040c649646b6491ff3f4b93a5c5605ea3c2b | demo/lisp/baxter-ik-path.lisp | demo/lisp/baxter-ik-path.lisp | (require :amino)
(in-package :robray)
(sb-posix:setenv "ROS_PACKAGE_PATH" "/opt/ros/indigo/share/" 1)
(setq *scene-graph* (load-scene-file "package://baxter_description/urdf/baxter.urdf"))
(defparameter *sub-scene-graph* (scene-graph-chain *scene-graph* nil "right_w2"))
(win-set-scene-graph *scene-graph*)
(win-ru... | Add path IK lisp demo | Add path IK lisp demo
| Common Lisp | bsd-3-clause | golems/amino,ndantam/amino,golems/amino,golems/amino,golems/amino,ndantam/amino,ndantam/amino,golems/amino,ndantam/amino,ndantam/amino,golems/amino,ndantam/amino | |
757ed07903c0c87a9fb34de7d81d0bb7f56a9631 | lisp/common-lisp/chap2/ex7.lisp | lisp/common-lisp/chap2/ex7.lisp | ; Using only operators introduced in this chapter define a function
; that takes a list as an argument and returns true if one of its
; elements is a list
(defun has_list_recursive (lst)
(if (null lst)
nil
(if (listp (car lst))
t
(has_list_recursive (cdr lst))))
)
(has_list_recursive '(a b c... | Add new lisp example problem file. Save updates to cashflow and make-cscope.sh | Add new lisp example problem file.
Save updates to cashflow and make-cscope.sh
| Common Lisp | apache-2.0 | loafdog/loaf-src,loafdog/loaf-src,loafdog/loaf-src,loafdog/loaf-src,loafdog/loaf-src,loafdog/loaf-src | |
26c98f592e516e8a3e9f7dd1546ac825c99de813 | README.creole | README.creole | = The Molly Project =
http://mollyproject.org/
The Molly Project is a Django-based Python application which provides a
framework for creating a mobile web portal for higher education institutions.
Please do Fork our code! We're looking for more contributors to the project.
== Get Started ==
The 'quickinstall' scri... | = The Molly Project =
http://mollyproject.org/
The Molly Project is a Django-based Python application which provides a
framework for creating a mobile web portal for higher education institutions.
Please do Fork our code! We're looking for more contributors to the project.
== Get Started ==
The 'quickinstall' scri... | Add link to issue tracker | Add link to issue tracker
| Creole | apache-2.0 | mollyproject/mollyproject,mollyproject/mollyproject,mollyproject/mollyproject |
2f07887c099eba3e5ce231568ef14aa939810d36 | docs/content/recipes/rich-text-editor.creole | docs/content/recipes/rich-text-editor.creole | ---
title: Adding a Rich Text Editor
parent_title: Recipes
previous_title:
previous_link:
next_title: Custom Actions
next_link: /recipes/custom-actions/
---
= Adding a Rich Text Editor
Download **CKEditor** and uncompress it under the {{{public/javascripts}}}
folder.
{{{
$ cd public/javascripts
$ curl -O http:... | ---
title: Adding a Rich Text Editor
parent_title: Recipes
previous_title:
previous_link:
next_title: Custom Actions
next_link: /recipes/custom-actions/
---
= Adding a Rich Text Editor
You can add a **Rich Text Editor**, ([[http://ckeditor.com/|CKEditor]]), to
your application by running the following task into ... | Use a template to add CKEditor support | [docs] Use a template to add CKEditor support
| Creole | mit | thirdthing/typus,typus/typus,readyfor/typus,thirdthing/typus,wollzelle/typus,typus/typus,burn-notice/typus,baban/typus,chiragshah/typus,wollzelle/typus,typus/typus,baban/typus,thirdthing/typus,burn-notice/typus,typus/typus,baban/typus,burn-notice/typus,chiragshah/typus,readyfor/typus,brainsome-de/typus,brainsome-de/typ... |
5372e8752580568b8b569c9532758f580b77ad24 | spec/charly_spec.cr | spec/charly_spec.cr | require "./spec_helper"
describe Interpreter do
it "runs the spec suite" do
# Build the interpreter
Process.run("crystal", [
"build",
"src/charly.cr",
"--release",
"--stats",
"-o bin/charly"
], output: STDOUT, input: STDIN, error: STDERR)
# Set the environment variable... | require "./spec_helper"
describe Interpreter do
it "runs the spec suite" do
# Create the bin directory
Process.run("mkdir", [
"bin"
])
# Build the interpreter
Process.run("crystal", [
"build",
"src/charly.cr",
"--release",
"--stats",
"-o bin/charly"
], ou... | Create the bin directory in the travis build | Create the bin directory in the travis build
| Crystal | mit | KCreate/charly-lang,charly-lang/charly |
df40559c127a25db93febef66f8e03b61ae85e31 | src/web_app_skeleton/src/pages/main_layout.cr | src/web_app_skeleton/src/pages/main_layout.cr | class MainLayout
include LuckyWeb::Page
include LuckyWeb::Layout
@page : BasePage
render do
html_doctype
html do
head do
utf8_charset
title @page.page_title
css_link asset("css/app.css")
js_link asset("js/app.js")
end
body do
@page.render_inn... | class MainLayout
include LuckyWeb::Page
include LuckyWeb::Layout
@page : BasePage
render do
html_doctype
html lang: "en" do
head do
utf8_charset
title @page.page_title
css_link asset("css/app.css")
js_link asset("js/app.js")
end
body do
@page... | Add default lang to layout | Add default lang to layout
Closes #46
| Crystal | mit | luckyframework/cli,luckyframework/cli,luckyframework/cli |
85df85f7bcf46e1cf043a7905cc7bfdac6ff13c8 | src/discordcr/mappings.cr | src/discordcr/mappings.cr | require "json"
module Discordcr
module REST
# A response to the Get Gateway REST API call.
struct GatewayResponse
JSON.mapping(
url: String
)
end
end
end
| require "json"
module Discordcr
module REST
# A response to the Get Gateway REST API call.
struct GatewayResponse
JSON.mapping(
url: String
)
end
end
struct GatewayPacket
JSON.mapping(
op: UInt8,
d: Nil,
s: UInt32 | Nil,
t: String | Nil
)
end
| Add a mapping for gateway packets | Add a mapping for gateway packets
| Crystal | mit | meew0/discordcr |
28bbbe356f101d6fa4ad1f14d933dca6f4fcb94f | src/discordcr/rest.cr | src/discordcr/rest.cr | require "http/client"
require "openssl/ssl/context"
require "./mappings"
module Discordcr
module REST
SSL_CONTEXT = OpenSSL::SSL::Context::Client.new
def request(endpoint_key : Symbol, method : String, url : String | URI, headers : HTTP::Headers, body : String | Nil)
HTTP::Client.exec(method: method,... | require "http/client"
require "openssl/ssl/context"
require "./mappings"
module Discordcr
module REST
SSL_CONTEXT = OpenSSL::SSL::Context::Client.new
def request(endpoint_key : Symbol, method : String, url : String | URI, headers : HTTP::Headers, body : String | Nil)
headers["Authorization"] = @token... | Set the Authorization header to the token | Set the Authorization header to the token
| Crystal | mit | meew0/discordcr |
bf6eb6e4e752ff3bb28d286a96de4bc74a435c7e | spec/m3u8/playlist_spec.cr | spec/m3u8/playlist_spec.cr | require "./../spec_helper"
describe M3U8::Playlist do
describe "when creating a playlist" do
let(playlist) { M3U8::Playlist.new }
it "inserts the base header" do
output = \
"#EXTM3U\n" \
"\n"
expect(playlist.to_s).to eq(output)
end
describe "media playlist" do
... | require "./../spec_helper"
describe M3U8::Playlist do
describe "when creating a playlist" do
let(playlist) { M3U8::Playlist.new }
it "inserts the header" do
expect(playlist.to_s).to match(/#EXTM3U\n/)
end
describe "media playlist" do
it "accepts new segments" do
playlist.add_seg... | Validate independent parts instead of the whole output | test: Validate independent parts instead of the whole output
| Crystal | mit | marceloboeira/m3u8,marceloboeira/m3u8 |
16be296e1d40b427c501b20cd59ea24e6220cfaf | kernel/src/lib/pointer.cr | kernel/src/lib/pointer.cr | struct Pointer(T)
def +(other : Int)
self + other.to_i64
end
def []=(offset, value)
(self + offset).value = value
end
end | struct Pointer(T)
def +(other : Int)
self + other.to_i64
end
def []=(offset : Int, value : T)
(self + offset).value = value
end
end | Add safety constraints to Pointer | Add safety constraints to Pointer
| Crystal | mit | TheKernelCorp/NuummiteOS |
8c69afc70cf40c6ea93329135d23af1dc4bab7ab | src/crustache/filesystem.cr | src/crustache/filesystem.cr | require "./tree.cr"
module Crustache
abstract class FileSystem
abstract def load(value : String) : Tree::Template?
def load!(value : String) : Tree::Template
if tmpl = self.load value
return tmpl
else
raise "#{value} is not found"
end
end
end
class HashFileSystem <... | require "./tree.cr"
module Crustache
abstract class FileSystem
abstract def load(value : String) : Tree::Template?
def load!(value : String) : Tree::Template
if tmpl = self.load value
return tmpl
else
raise "#{value} is not found"
end
end
end
class HashFileSystem <... | Add extensions for implicit loading | Add extensions for implicit loading
| Crystal | mit | MakeNowJust/crustache |
b9739a8444d1c51663fe1fa5445e8d8e179b9a37 | spec/support/mock_request.cr | spec/support/mock_request.cr | class MockRequest < HTTP::Request
def initialize
end
end
| class MockRequest
def initialize
end
def get(path : String, headers = Hash.new : Hash(String, String | Array(String)))
http_headers = HTTP::Headers.new
headers.each do |key, value|
http_headers.add(key, value)
end
HTTP::Request.new("GET", path, http_headers)
end
end
| Add a basic MockRequest for mocking a HTTP::Request | Add a basic MockRequest for mocking a HTTP::Request | Crystal | mit | benoist/carbon-crystal,benoist/carbon-crystal |
3d99e50ac02889ba880ded330b5f0b012194b472 | config/application.cr | config/application.cr | AMBER_PORT = ENV["PORT"]? || 3008
AMBER_ENV = ENV["AMBER_ENV"]? || "development"
require "amber"
require "./initializers/*"
Amber::Server.instance.config do |app|
app_path = __FILE__
app.name = "Crystal [ANN] web application."
app.port = AMBER_PORT.to_i
app.env = AMBER_ENV.to_s
app.log = ::Logger.new(STDOU... | AMBER_PORT = ENV["PORT"]? || 3008
AMBER_ENV = ENV["AMBER_ENV"]? || "development"
require "amber"
require "./initializers/*"
Amber::Server.instance.config do |app|
app_path = __FILE__
app.name = "Crystal [ANN] web application."
app.port = AMBER_PORT.to_i
app.env = AMBER_ENV.to_s
app.log = ::Logger.new(STDOU... | Expire session when browser is closed | Expire session when browser is closed
| Crystal | mit | crystal-community/crystal-ann |
0f97690c97c35df9cb157b602fb9b999c818449b | src/crustache.cr | src/crustache.cr | require "./crustache/*"
module Crustache
# :nodoc:
OPEN_TAG = "{{".to_slice
# :nodoc:
CLOSE_TAG = "}}".to_slice
def self.parse(string : String, filename = "<inline>", row = 1) : Tree::Template
self.parse StringIO.new(string), filename, row
end
def self.parse(io : IO, filename = "<inline>", row = 1)... | require "./crustache/*"
module Crustache
# :nodoc:
OPEN_TAG = "{{".to_slice
# :nodoc:
CLOSE_TAG = "}}".to_slice
def self.parse(string : String, filename = "<inline>", row = 1) : Tree::Template
self.parse StringIO.new(string), filename, row
end
def self.parse(io : IO, filename = "<inline>", row = 1)... | Fix a bug that FileSystem can't create instance | Fix a bug that FileSystem can't create instance
| Crystal | mit | MakeNowJust/crustache |
b02601c199c08177006a77d6b3d9fed73c0569e4 | src/discordcr/mappings/gateway.cr | src/discordcr/mappings/gateway.cr | require "./converters"
require "./user"
require "./channel"
module Discord
module Gateway
struct ReadyPayload
JSON.mapping(
v: UInt8,
user: User,
private_channels: Array(PrivateChannel),
guilds: Array(UnavailableGuild),
session_id: String
)
end
struct ... | require "./converters"
require "./user"
require "./channel"
require "./guild"
module Discord
module Gateway
struct ReadyPayload
JSON.mapping(
v: UInt8,
user: User,
private_channels: Array(PrivateChannel),
guilds: Array(UnavailableGuild),
session_id: String
)
... | Add a mapping for the GUILD_EMOJI_UPDATE dispatch payload | Add a mapping for the GUILD_EMOJI_UPDATE dispatch payload
| Crystal | mit | meew0/discordcr |
7619f0b3ec155d730ac4a1b920e51cd9121a7570 | src/discordcr/rest.cr | src/discordcr/rest.cr | require "http/client"
require "openssl/ssl/context"
require "./mappings"
require "./version"
module Discord
module REST
SSL_CONTEXT = OpenSSL::SSL::Context::Client.new
USER_AGENT = "DiscordBot (https://github.com/meew0/discordcr, #{Discord::VERSION})"
def request(endpoint_key : Symbol, method : String... | require "http/client"
require "openssl/ssl/context"
require "./mappings"
require "./version"
module Discord
module REST
SSL_CONTEXT = OpenSSL::SSL::Context::Client.new
USER_AGENT = "DiscordBot (https://github.com/meew0/discordcr, #{Discord::VERSION})"
def request(endpoint_key : Symbol, method : String... | Remove the fiber spawn in request | Remove the fiber spawn in request
| Crystal | mit | meew0/discordcr |
f42e3a9e454cd33fb37f1eab7ad23d0e4a527a71 | kernel/src/lib/int.cr | kernel/src/lib/int.cr | struct Int
def <<(count) unsafe_shl count end
def >>(count) unsafe_shr count end
def /(other : Int)
if other == 0
self
end
unsafe_div other
end
def times
i = 0
while i < self
yield i
i += 1
end
end
end | struct Int
def <<(count) unsafe_shl count end
def >>(count) unsafe_shr count end
def ===(other : Int) self == other end
def /(other : Int)
if other == 0
self
end
unsafe_div other
end
def times
i = 0
while i < self
yield i
... | Add === override to Int | Add === override to Int
| Crystal | mit | TheKernelCorp/NuummiteOS |
218f26753858109760d36222e7e051e9032b57c6 | spec/m3u8/master_playlist_spec.cr | spec/m3u8/master_playlist_spec.cr | require "./../spec_helper"
describe M3U8::MasterPlaylist do
context "when rendering a playlist" do
let(streams) { [ M3U8::MasterPlaylist::Stream.new("low.m3u8"),
M3U8::MasterPlaylist::Stream.new("medium.m3u8"),
M3U8::MasterPlaylist::Stream.new("high.m3u8") ] }
let(pl... | require "./../spec_helper"
describe M3U8::MasterPlaylist do
context "when rendering a playlist" do
let(streams) { [ M3U8::MasterPlaylist::Stream.new("low.m3u8"),
M3U8::MasterPlaylist::Stream.new("medium.m3u8"),
M3U8::MasterPlaylist::Stream.new("high.m3u8") ] }
let(pl... | Add scenario with empty line between header and the rest | test: Add scenario with empty line between header and the rest
| Crystal | mit | marceloboeira/m3u8,marceloboeira/m3u8 |
16dbb98ca5bf419c5e176d4d8f62d88106e0dd56 | src/discordcr/mappings/gateway.cr | src/discordcr/mappings/gateway.cr | require "./converters"
require "./user"
require "./channel"
module Discord
module Gateway
struct ReadyPayload
JSON.mapping(
v: UInt8,
user: User,
private_channels: Array(PrivateChannel),
guilds: Array(UnavailableGuild),
session_id: String
)
end
struct ... | require "./converters"
require "./user"
require "./channel"
module Discord
module Gateway
struct ReadyPayload
JSON.mapping(
v: UInt8,
user: User,
private_channels: Array(PrivateChannel),
guilds: Array(UnavailableGuild),
session_id: String
)
end
struct ... | Add a mapping for the GUILD_DELETE payload | Add a mapping for the GUILD_DELETE payload
| Crystal | mit | meew0/discordcr |
ebcd734580a14dd801147bc036a9849c6e1f7f0f | src/discordcr/cache.cr | src/discordcr/cache.cr | require "./mappings/*"
module Discord
class Cache
def initialize(@client : Client)
@users = Hash(UInt64, User).new
end
def resolve_user(id : UInt64) : User
@users.fetch(id) { @users[id] = @client.get_user(id) }
end
def cache(user : User)
@users[user.id] = user
end
end
en... | require "./mappings/*"
module Discord
class Cache
def initialize(@client : Client)
@users = Hash(UInt64, User).new
@channels = Hash(UInt64, Channel).new
end
def resolve_user(id : UInt64) : User
@users.fetch(id) { @users[id] = @client.get_user(id) }
end
def resolve_channel(id :... | Add support for channel caching | Add support for channel caching
| Crystal | mit | meew0/discordcr |
e077d17943d8f03f6ba9703791088cca9733ebed | src/kemal/common_exception_handler.cr | src/kemal/common_exception_handler.cr | class Kemal::CommonExceptionHandler < HTTP::Handler
INSTANCE = new
def call(context)
begin
call_next context
rescue ex : Kemal::Exceptions::RouteNotFound
context.response.content_type = "text/html"
Kemal.config.logger.write("Exception: #{ex.inspect_with_backtrace.colorize(:red)}\n")
... | class Kemal::CommonExceptionHandler < HTTP::Handler
INSTANCE = new
def call(context)
begin
call_next context
rescue ex : Kemal::Exceptions::RouteNotFound
context.response.content_type = "text/html"
Kemal.config.logger.write("Exception: #{ex.inspect_with_backtrace}\n")
return render_... | Remove colorize from common exception handler | Remove colorize from common exception handler
| Crystal | mit | MGerrior/kemal,kemalcr/kemal,sdogruyol/kemal,sdogruyol/kemal,MGerrior/kemal |
10fd49697e89402e966e8a7a83e7c1c56ae9758a | src/discordcr/client.cr | src/discordcr/client.cr | require "http/web_socket"
require "./rest"
module Discordcr
class Client
include REST
def initialize(@token : String, @client_id : UInt64)
end
def run
url = gateway.url
url += "?v=6&encoding=json"
@websocket = HTTP::WebSocket.new(URI.parse(url))
@websocket.not_nil!.on_messa... | require "http/web_socket"
require "./rest"
module Discordcr
class Client
include REST
def initialize(@token : String, @client_id : UInt64)
end
def run
url = gateway.url
url += "?v=6&encoding=json"
@websocket = websocket = HTTP::WebSocket.new(URI.parse(url))
websocket.on_mes... | Use a local variant of the websocket to avoid the not_nil! checks | Use a local variant of the websocket to avoid the not_nil! checks
| Crystal | mit | meew0/discordcr |
c03e174527aaf92260445970c3b2947bfb00bcb1 | spec/conditionals/case_spec.cr | spec/conditionals/case_spec.cr | require "../spec_helper"
describe Crow do
it "should convert simple case statements" do
crystal = <<-CR
value = "foo"
case value
when "foo"
p "yes"
when "bar"
p "no"
else
p "hiyaa"
end
CR
flow = <<-JS
const value = "foo";
switch (value) {
case "foo":... | require "../spec_helper"
describe Crow do
it "should convert simple case statements" do
crystal = <<-CR
value = "foo"
case value
when "foo"
p "yes"
when "bar"
p "no"
else
p "hiyaa"
end
CR
flow = <<-JS
const value = "foo";
switch (value) {
case "foo":... | Add spec for missing else in case statement | Add spec for missing else in case statement
| Crystal | mit | geppetto-apps/crow |
1e706f6aeabfcd5476017a29aa9b7b38d6d87b79 | kernel/src/lib/runtime/indexable.cr | kernel/src/lib/runtime/indexable.cr | module Indexable(T)
abstract def size
abstract def unsafe_at(index : Int)
def at(index : Int)
index = check_index_out_of_bounds index do
return yield
end
unsafe_at index
end
@[AlwaysInline]
def at(index : Int)
at(index) { panic "Invalid index!" }
end
@[AlwaysInline]
def [](ind... | module Indexable(T)
abstract def size
abstract def unsafe_at(index : Int)
def at(index : Int)
index = check_index_out_of_bounds index do
return yield
end
unsafe_at index
end
@[AlwaysInline]
def at(index : Int)
at(index) { panic "Invalid index!" }
end
@[AlwaysInline]
def [](ind... | Fix a bug in Indexable(T) This fixes a bug where calling `Indexable(T).[]?` wouldn't compile. | Fix a bug in Indexable(T)
This fixes a bug where calling `Indexable(T).[]?` wouldn't compile.
Signed-off-by: Splitty <e8820feff88402cc56882fceaf96271e952e1a96@gmail.com>
| Crystal | mit | TheKernelCorp/NuummiteOS |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.