This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (in-package :cl-user) | |
| (defpackage :testread | |
| (:use cl)) | |
| (in-package :testread) | |
| (defparameter *old-readtable* (copy-readtable) "") | |
| (defparameter *new-readtable* (copy-readtable) "") | |
| (defparameter *syms* (make-hash-table)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | |
| echo ${SCRIPTPATH} | |
| if [ -d "${SCRIPTPATH}/bin" ] ; then | |
| PATH="${SCRIPTPATH}/bin:$PATH" | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun main () | |
| (let* ((JFrame (jclass "javax.swing.JFrame")) | |
| (JButton (jclass "javax.swing.JButton")) | |
| (BorderLayout (jclass "java.awt.BorderLayout")) | |
| (demo (jnew JFrame "Layout Demo")) | |
| (east (jnew JButton "East")) | |
| (south (jnew JButton "South")) | |
| (west (jnew JButton "West")) | |
| (north (jnew JButton "North")) | |
| (center (jnew JButton "Center"))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;; init-local.el -- load my config | |
| ;;; Commentary: | |
| ;;; load my config | |
| ;;; Code: | |
| ;;; | |
| ;;; load send-term | |
| (load "../my-lisp/send-term/send-term.el") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun Decorators (stream ch1) | |
| (declare (ignore ch1)) | |
| (let ((Decorator (read stream)) | |
| (the-func-form (read stream))) | |
| (unless (eq (first the-func-form) 'defun) | |
| (error "need 'defun")) | |
| (let ((the-func-name (second the-func-form)) | |
| (the-func-args (third the-func-form)) | |
| (the-func (cdddr the-func-form))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (require :cffi) | |
| (defpackage my-example | |
| (:use :cl :cffi)) | |
| (in-package my-example) | |
| ;; example: direct call | |
| (foreign-funcall "printf" :string (format nil "%s: %d~%") ;; need change ~% to \0 in c.(end for string) | |
| :string "Hello" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (set-dispatch-macro-character #\# #\o | |
| (lambda (s c1 c2) | |
| (declare (ignore c1 c2)) | |
| (let* ((form (read s)) | |
| (obj (car form)) | |
| (method (cadr form)) | |
| (args (cddr form))) | |
| `(,method ,obj ,@args)))) | |
| (defmethod run ((name string)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| These files flow BSD-3 | |
| - init-local.el | |
| Copyright (c) 2018, lagagain | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without | |
| modification, are permitted provided that the following conditions are met: | |
| * Redistributions of source code must retain the above copyright notice, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Copyright (c) 2018, lagagain | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without | |
| modification, are permitted provided that the following conditions are met: | |
| * Redistributions of source code must retain the above copyright notice, | |
| this list of conditions and the following disclaimer. | |
| * Redistributions in binary form must reproduce the above copyright | |
| notice, this list of conditions and the following disclaimer in the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (define-condition div-by-zero () | |
| ((message :initarg :message | |
| :accessor message | |
| :initform "" | |
| :type 'string)) | |
| (:report (lambda (c s) (format s "Can not div by zero: ~A~&" (message c))))) | |
| (defun prompt (message) | |
| (format t message) | |
| (read)) |