Giter VIP home page Giter VIP logo

anaphora's Introduction

Build Status

Overview

Anaphoric expressions for Emacs Lisp, providing implicit temporary variables.

Quickstart

(require 'anaphora)
 
(awhen (big-long-calculation)
  (foo it)      ; `it` is provided as
  (bar it))     ; a temporary variable
 
;; anonymous function to compute factorial using `self`
(alambda (x) (if (= x 0) 1 (* x (self (1- x)))))
 
;; to fontify `it' and `self'
(with-eval-after-load "lisp-mode"
  (anaphora-install-font-lock-keywords))

anaphora

Anaphoric expressions implicitly create one or more temporary variables which can be referred to during the expression. This technique can improve clarity in certain cases. It also enables recursion for anonymous functions.

To use anaphora, place the anaphora.el library somewhere Emacs can find it, and add the following to your ~/.emacs file:

(require 'anaphora)

The following macros are made available

aand
ablock
acase
acond
aecase
aetypecase
apcase
aif
alambda
alet
aprog1
aprog2
atypecase
awhen
awhile
a+
a-
a*
a/

The following macros are experimental

anaphoric-set
anaphoric-setq

See Also

Notes

Partially based on examples from the book "On Lisp", by Paul Graham.

When this library is loaded, the provided anaphoric forms are registered as keywords in font-lock. This may be disabled via customize.

Compatibility and Requirements

GNU Emacs version 26.1           : yes
GNU Emacs version 25.x           : yes
GNU Emacs version 24.x           : yes
GNU Emacs version 23.x           : yes
GNU Emacs version 22.x           : yes
GNU Emacs version 21.x and lower : unknown

No external dependencies

anaphora's People

Contributors

nagy avatar nicferrier avatar rolandwalker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

anaphora's Issues

please tag releases

Could you please tag releases. If you have already done so and are wondering what I am talking about: tags have to be pushed explicitly using git push --tags. -- Thanks

Can't load anaphora in Emacs 26.2 (Windows 10, x64)

After having downloaded anaphora on melpa, on evaluating (require 'anaphora) in Emacs (26.2 (build 1, x86_64-w64-mingw32)) in Windows 10, here is an error message:

Debugger entered--Lisp error: (error "Loading file d:/myhome/.emacs.d/elpa/anaphora-20180618.2200/anaphora.el failed to provide feature ‘anaphora’")
#<subr require>(anaphora nil nil)
ad-Advice-require(#<subr require> anaphora)
apply(ad-Advice-require #<subr require> anaphora)
require(anaphora)

More examples?

It would be helpful to have examples for each macro. :)

evaluating breaks whitespace-mode

When I evaluate anaphora my whitespace markup changes from a nice subtle pink background to a very jarring hard dotted thing.

Obviously this is to do with adding the syntax for the anaphora stuff but I can't work out how.

Any clues?

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.