-
Notifications
You must be signed in to change notification settings - Fork 3
/
example.ros
executable file
·55 lines (38 loc) · 1.13 KB
/
example.ros
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
#|-*- mode:lisp -*-|#
#| <Put a one-line description here>
exec ros -Q -- $0 "$@"
|#
(progn ;;init forms
(push "./" asdf:*central-registry*)
(ql:quickload 'log4cl-extras))
(defpackage :ros.script.example.3694141461
(:use :cl))
(in-package :ros.script.example.3694141461)
(declaim (optimize (speed 1) (safety 3) (debug 3)))
(defun bar (bar &key (boo "baz"))
(let* ((other "value2")
(result (format nil "~a ~a ~a" bar boo other)))
(error "The message")
result))
(defun other ()
(log:info "Some number was generated " (random 100)))
(defun foo ()
(other)
(bar 1))
(defun handle-request (id)
(foo))
(defun main (&rest argv)
(declare (ignorable argv))
(log4cl-extras/config:setup)
(let ((request-id 42))
(log4cl-extras/context:with-fields (:|request_id| request-id)
(log:info "Incoming request")
(handler-case
(log4cl-extras/error:with-log-unhandled ()
(handle-request request-id))
(error ()
(log:error "Exiting because of unhandled exception")
(uiop:quit 1)))
(log:info "Done"))))
;;; vim: set ft=lisp lisp: