Skip to content

Instantly share code, notes, and snippets.

@svetlyak40wt
Created January 22, 2017 19:32
Show Gist options
  • Save svetlyak40wt/c397649f69901fa82be7832adfe04cb0 to your computer and use it in GitHub Desktop.
Save svetlyak40wt/c397649f69901fa82be7832adfe04cb0 to your computer and use it in GitHub Desktop.
Lisp's consistent white spacing, using magic format function
#!/bin/sh
#|-*- mode:lisp -*-|#
#| <Put a one-line description here>
exec ros -Q -- $0 "$@"
|#
(progn ;;init forms
)
(defpackage :ros.script.test-me.3694101834
(:use :cl))
(in-package :ros.script.test-me.3694101834)
(defun main (&rest argv)
(declare (ignorable argv))
(format t "Without new line")
(format t "~2&DONE~%")
(format t "With new line~%")
(format t "~2&DONE~%")
;; Gives
;; Without new line
;;
;; DONE
;; With new line
;;
;; DONE
;;
;; Count of empty lines DOES NOT depends on if first line ends with new line symbol
)
;;; vim: set ft=lisp lisp:
#!/bin/bash
printf "Without new line"
printf "\n\nDONE\n"
printf "With new line\n"
printf "\n\nDONE\n"
# Gives
# Without new line
#
# DONE
# With new line
#
#
# DONE
#
# Count of empty lines DEPENDS on if first line ends with new line symbol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment