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
| (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
| ;;; 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 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
| #! /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
| (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
| def myClassmethod(m, *arg, **karg): | |
| def _m(cls, *arg, **karg): | |
| cls = cls if isinstance(cls, type(int)) else cls.__class__ | |
| return m(cls, *arg, **karg) | |
| return _m | |
| def myStaticmethod(m, *arg, **karg): | |
| def _m(*arg, **karg): | |
| if len(arg) > 0: | |
| if m.__name__ in dir(arg[0].__class__): |
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
| b0d1630... 04/14/19 13:31 public | |
| + d9aa1d7... 04/13/19 23:14 public classmethod and staticmethod implement for python3.6 | |
| + d71a4fd... 04/12/19 09:33 public | |
| c2c8790... 03/21/19 11:12 public | |
| + 648c7e1... 03/12/19 23:06 public JAVA GUI / ABCL GUI | |
| 4f0b15e... 02/21/19 09:49 public | |
| 5be04a4... 02/08/19 18:13 private | |
| + 2d30a57... 02/08/19 18:11 private EOSIO-contract eoshop | |
| e1d8bdb... 12/11/18 20:40 public 自制@裝飾器 | |
| c145d35... 12/11/18 19:51 public [practice] [Common Lisp] CFFI - c-printf example (Common Lisp) |
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 'abcl-contrib) | |
| (require 'abcl-asdf) | |
| (require 'jss) | |
| (defpackage id.lag.tesabcl | |
| (:use cl abcl-contrib abcl-asdf jss java)) | |
| (in-package id.lag.tesabcl) | |
| (jcall "println" #"java.lang.System.out" "Hello, World") |
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) 2019, 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 |