summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/socket.tl6
1 files changed, 6 insertions, 0 deletions
diff --git a/share/txr/stdlib/socket.tl b/share/txr/stdlib/socket.tl
index 1c54c6eb..b6ad135e 100644
--- a/share/txr/stdlib/socket.tl
+++ b/share/txr/stdlib/socket.tl
@@ -142,3 +142,9 @@
(cand-prefix [pieces 0..(trunc (+ w 15) 16)])
(prefix (if (search cand-prefix '(0 0)) pieces cand-prefix)))
`@(sys:in6addr-condensed-text prefix)/@(or width w)`))))
+
+(defplace (sock-peer sock) body
+ (getter setter
+ ^(macrolet ((,getter () ^(sock-peer ',',sock))
+ (,setter (val) ^(sock-set-peer ,',sock ,val)))
+ ,body)))