Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cmoore's full-sized avatar
🆑

Clint Moore cmoore

🆑
View GitHub Profile
(--->
op "clone"
id "19"
)
(<-
id "19"
new-session "c82858e6-6033-4cc4-b07d-00abc3f86355"
session "03205e3c-324f-423a-ab8c-3bc3ab23f2dc"
status ("done")
)
;; The model macro
;;
;; Requires
;; - Postmodern
;; - A running Postgreql server.
;;
;; Package requirements
;; - Postmodern
;; - local-time
;; - cl-postgres+local-time
(defvar *previous-readtables* nil)
(defmacro enable-toml-syntax ()
'(eval-when (:compile-toplevel :load-toplevel :execute)
(push *readtable* *previous-readtables*)
(setq *readtable* (copy-readtable))
(set-macro-character #\[ 'read-left-bracket)
; more calls to (set-macro-character)
...))
[04:13:40 INFO]: hydo: Opped hydo
[04:13:48 INFO]: hydo issued server command: /gm c
[04:13:52 INFO]: hydo issued server command: /time set 1000
[04:14:00 INFO]: hydo issued server command: /weather clear
[04:14:41 INFO]: hydo issued server command: /npc create Bob The Builder
[04:14:56 INFO]: hydo issued server command: /trait builder
[04:17:43 INFO]: hydo issued server command: /builder load kataphane
[04:18:07 INFO]: hydo issued server command: /builder origin
[04:18:13 INFO]: hydo issued server command: /builder build
[04:18:13 ERROR]: null
public class Utils {
public static List<Chest> find_all_chests(World world) {
List<Chest> chests = new ArrayList();
int tile_entities = 0;
for (Chunk c : world.getLoadedChunks()) {
for (BlockState b : c.getTileEntities()) {
tile_entities++;
// The listener class for Beton...
package io.ivy.fawkes.beton;
import pl.betoncraft.betonquest.core.QuestEvent;
public class TestEvent extends QuestEvent {
public TestEvent(String playerID, String instructions) {
super(playerID, instructions);
System.out.println("TEST EVENT");
}
package me.swiftymove.Command;
import net.canarymod.Canary;
import net.canarymod.commandsys.CommandDependencyException;
import net.canarymod.plugin.Plugin;
public class Main extends Plugin{
@Override
public void disable() {
private void show_tags(CompoundTag ctag, Player player) {
ctag.keySet().forEach(new Consumer<String>() {
@Override
public void accept(String s) {
player.notice("S: " + s + " V: " + ctag.get(s).toString());
}});
}
}
@HookHandler
public void onBlockRightClickHook(BlockRightClickHook hook) {
if (hook.getPlayer().getWorld().getFqName().equals("ctf_NORMAL")) {
hook.getBlockClicked().getPropertyKeys().forEach(new Consumer<BlockProperty>() {
@Override
public void accept(BlockProperty prop) {
hook.getPlayer().notice("P: ".concat(prop.getName()));
}});
}
}

Reader Macros in Common Lisp

Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.

Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):

The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.

Macros and read-macros see your program at different stages. Macros get hold of the program when it has already been parsed into Lisp objects by the reader, and read-macros operate on a program while it is still text. However, by invoking read on this text, a read-macro can, if it chooses, get parsed Lisp objects as well. Thus read-macros are at least as powerful as ordinary macros.