From 6ab59c4446abd84a176183d92844009b7052a6b6 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Thu, 28 Dec 2017 17:56:38 -0800 Subject: [PATCH] present: add callable and pointer defs. --- basis/present/present.factor | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/basis/present/present.factor b/basis/present/present.factor index eae0f43021..975973e84d 100644 --- a/basis/present/present.factor +++ b/basis/present/present.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors effects io.pathnames kernel math math.parser -sequences strings vocabs words ; +USING: accessors alien.c-types effects io.pathnames kernel math +math.parser quotations sequences strings vocabs words ; IN: present GENERIC: present ( object -- string ) @@ -27,3 +27,13 @@ M: effect present effect>string ; M: f present drop "" ; M: pathname present string>> ; + +M: callable present + [ "[ ]" ] [ + [ drop "[ " ] + [ [ present ] map " " join ] + [ drop " ]" ] tri 3append + ] if-empty ; + +M: pointer present + to>> name>> "*" append ;