This is the burgled-batteries.syntax Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 03:31:24 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
burgled-batteries.syntax
Embedded Python syntax for burgled-batteries
Mariano Montone
MIT
# burgled-batteries.syntax
[![Quicklisp](http://quickdocs.org/badge/burgled-batteries.syntax.svg)](http://quickdocs.org/burgled-batteries.syntax/)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
This library provides Embedded Python syntax for burgled-batteries
To enable the syntax:
“‘lisp
(python.syntax:enable-python-syntax)
“‘
Python syntax is enclosed between brackets. The embedded syntax is very similar to Python’s syntax, with some differences:
* Identifiers staring with the ‘$‘ character are parsed as Lisp variable references.
* To convert the Python expression result to a Lisp object, use the ‘^‘ operator.
* Lisp expressions can be embedded in Python code, with this syntax: ‘$(<lisp expression>)‘
Example:
“‘lisp
(let (($url "http://pinterface.livejournal.com/data/atom"))
[^feedparser.parse($url)])
“‘
Some examples:
“‘lisp
(import :feedparser)
[^feedparser.parse(’http://pinterface.livejournal.com/data/atom’)]
; => #<HASH-TABLE>
“‘
To explore what is happening behind the scenes, quote the Python expression:
“‘lisp
PYTHON> ’[^.feedparser.parse(’http://pinterface.livejournal.com/data/atom’)]
(LET ((#:TRANSFORMED2520
(CFFI:CONVERT-FROM-FOREIGN
(CALL* (REF* "feedparser") "parse"
(STRING.FROM-STRING*
"http://pinterface.livejournal.com/data/atom"))
’PYTHON.CFFI::OBJECT!)))
#:TRANSFORMED2520)
“‘
Bigger example:
“‘lisp
PYTHON> (let (($cal [icalendar.Calendar()]))
[$cal.add(’prodid’, ’-//My calendar product//mxm.dk//’)]
(let (($event [icalendar.Event()]))
[$event.add(’summary’, ’Python meeting about calendaring’)]
[$event.add(’dtstart’, datetime.datetime(2005,4,4,8,0,0))]
[$event.add(’dtend’, datetime.datetime(2005,4,4,10,0,0))]
[$event.add(’dtstamp’, datetime.datetime(2005,4,4,0,10,0))]
(let (($organizer [icalendar.vCalAddress(’MAILTO: noone@example.com’)]))
[$organizer.params[’cn’] = icalendar.vText(’Max Rasmussen’)]
[$organizer.params[’role’] = icalendar.vText(’CHAIR’)]
[$event[’organizer’] = $organizer]
[$event[’location’] = icalendar.vText(’Odense, Denmark’)]
[$event[’uid’] = ’20050115T101010/27346262376@mxm.dk’]
[$event.add(’priority’, 5)]
(let (($attendee [icalendar.vCalAddress(’MAILTO:maxm@example.com’)]))
[$attendee.params[’cn’] = icalendar.vText(’Max Rasmussen’)]
[$attendee.params[’ROLE’] = icalendar.vText(’REQ-PARTICIPANT’)]
[$event.add(’attendee’, $attendee, encode=0)])
(let (($attendee [icalendar.vCalAddress(’MAILTO:the-dude@example.com’)]))
[$attendee.params[’cn’] = icalendar.vText(’The Dude’)]
[$attendee.params[’ROLE’] = icalendar.vText(’REQ-PARTICIPANT’)]
[$event.add(’attendee’, $attendee, encode=0)])
[$cal.add_component($event)]
[^$cal.to_ical()])))
=>
"BEGIN:VCALENDAR
PRODID:-//My calendar product//mxm.dk//
BEGIN:VEVENT
SUMMARY:Python meeting about calendaring
DTSTART;VALUE=DATE-TIME:20050404T080000
DTEND;VALUE=DATE-TIME:20050404T100000
DTSTAMP;VALUE=DATE-TIME:20050404T001000Z
UID:20050115T101010/27346262376@mxm.dk
LOCATION:Odense\\, Denmark
MAILTO:MAXM@EXAMPLE.COM:attendee
MAILTO:THE-DUDE@EXAMPLE.COM:attendee
ORGANIZER;CN=\"Max Rasmussen\";ROLE=CHAIR:MAILTO: noone@example.com
PRIORITY:5
END:VEVENT
END:VCALENDAR"
“‘
For more examples, checkout the syntax tests or [this blog post](http://mmontone-programming.blogspot.com.ar/2014/09/embedding-python-in-common-lisp.html).
burgled-batteries
(system).
esrap
(system).
named-readtables
(system).
package.lisp
(file).
syntax.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
burgled-batteries.syntax/burgled-batteries.syntax.asd
burgled-batteries.syntax/package.lisp
burgled-batteries.syntax/syntax.lisp
burgled-batteries.syntax/burgled-batteries.syntax.asd
burgled-batteries.syntax
(system).
burgled-batteries.syntax/package.lisp
burgled-batteries.syntax
(system).
burgled-batteries.syntax/syntax.lisp
package.lisp
(file).
burgled-batteries.syntax
(system).
enable-python-syntax
(function).
*lisp-reference-prefix*
(special variable).
*transform-character*
(special variable).
call
(function).
call*
(function).
call-with-split-args
(function).
compile-expression
(function).
compile-expression%
(generic function).
compile-python
(function).
is-false
(function).
is-none
(function).
is-true
(function).
not-doublequote
(function).
parse-python
(function).
push-last
(macro).
py-slot-value
(function).
ref
(function).
ref*
(function).
run-python
(function).
send
(function).
send*
(function).
split-args
(function).
Packages are listed by definition order.
burgled-batteries.syntax
python.syntax
common-lisp
.
esrap
.
enable-python-syntax
(function).
*lisp-reference-prefix*
(special variable).
*transform-character*
(special variable).
call
(function).
call*
(function).
call-with-split-args
(function).
compile-expression
(function).
compile-expression%
(generic function).
compile-python
(function).
is-false
(function).
is-none
(function).
is-true
(function).
not-doublequote
(function).
parse-python
(function).
push-last
(macro).
py-slot-value
(function).
ref
(function).
ref*
(function).
run-python
(function).
send
(function).
send*
(function).
split-args
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
(eql :lisp-expression)
) expression) ¶(eql :transform)
) expression) ¶(eql :assignment)
) expression) ¶(eql :index-access)
) expression) ¶(eql :property-access)
) expression) ¶(eql :method-call)
) expression) ¶(eql :function-call)
) expression) ¶(eql :lisp-reference)
) expression) ¶(eql :python-reference)
) expression) ¶(eql :literal-dictionary)
) expression) ¶(eql :literal-list)
) expression) ¶(eql :literal-float)
) expression) ¶(eql :literal-long)
) expression) ¶(eql :literal-integer)
) expression) ¶(eql :literal-string)
) expression) ¶(eql :literal-none)
) expression) ¶(eql :literal-boolean)
) expression) ¶Jump to: | C E F G I M N P R S |
---|
Jump to: | C E F G I M N P R S |
---|
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Jump to: | B F P S |
---|
Jump to: | B F P S |
---|