Giter VIP home page Giter VIP logo

base's Introduction

com.google.base

Universally useful Common Lisp code.

The base package contains code that's highly likely to be useful in every Lisp application. The package contains:

ASDF fast-unsafe-source-file component

The ASDF component type FAST-UNSAFE-SOURCE-FILE allows you to specify maximum optimization for one Lisp source file. It is used just like the FILE component. In the system definition below, foo is compiled with default optimization settings, while bar is compiled for maximum run-time speed:

(defsystem example
  :defsystem-depends-on (com.google.base)
  :components
  ((:file "foo")
   (:fast-unsafe-source-file "bar")))

A nicer version of DEFCONSTANT

defconst name value &optional documentation

Identical to CL:DEFCONSTANT except that the global constant variable NAME is
bound to VALUE at compile time so it can be used in #. reader forms.
Additionally, if the DEFCONST form is evaluated a second time, the constant is
not rebound if the new value is EQUALP to the old.  CL:DEFCONSTANT requires
the two values be EQL to avoid undefined behavior.

A missing-argument function

missing-argument

Calls ERROR with an argument that indicates a required &KEY or &OPTIONAL
function argument was not supplied.  For example, the following function will
signal an error condition for a missing :AGE or :ADDRESS argument.

(defun foo (name &key (age (missing-argument)) (address (missing-argument)))
  ...
  )

A (MISSING-ARGUMENT) form also useful as the value of a slot :INITFORM when the
slot is required.  For instance, the following class definition ensures that a
value is supplied for SLOT when an instance is created:

(defclass foo ()
  ((slot
    :accessor :slot
    :initform (missing-argument))))

Types and functions for manipulating UTF-8 strings

octet

The type (UNSIGNED-BYTE 8).

octet-vector &optional length

The type `(SIMPLE-ARRAY OCTET (,LENGTH).

make-octet-vector octet-count &key initial-contents

Creates an OCTET-VECTOR containing OCTET-COUNT octets.  If INITIAL-CONTENTS is
not supplied, each element of the vector is initialized to zero.  Otherwise,
the vector is initialized to the contents of list INITIAL-CONTENTS.

string-to-utf8-octets string &key (start 0) (end (length string))

Converts STRING into an OCTET-VECTOR by UTF-8 encoding each character.

utf8-octets-to-string octets &key (start 0) (end (length octets))

Converts OCTETS, a vector of UTF-8 encoded octets, into a string.

Sequence functions

prefixp prefix sequence &key (test #'eql)

Does PREFIX match a prefix of SEQUENCE?

suffixp suffix sequence &key (test #'eql)

Does SUFFIX match a suffix of SEQUENCE?

Lisp type definitions for common C integer types

The following types are defined:

int8
int16
int32
int64
uint8
uint16
uint32
uint64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.