freenode/lisp - IRC Chatlog
Search
1:41:34
drmeister_
PuercoPop: Thank you - I looked into that. I'm trying to figure out what it does relative to Shinmera's "staple" system.
3:00:29
no-defun-allowed
Are you sure? I'm looking at https://github.com/sharplispers/ironclad and 25519 comes up about ten times.
3:02:38
no-defun-allowed
Would you mind trying: (ql:quickload :ironclad) (ironclad:generate-key-pair :ed25519)
9:37:35
gabbiel
for example, I want a glue generic function that will take &rest atoms and "glue" them
9:39:36
no-defun-allowed
can't specialise on &rest arguments, but maybe something like (defun glue (&rest parts) (reduce #'glue-two-parts parts)) could work
9:40:06
no-defun-allowed
or, use the printer: (defun glue (&rest parts) (format nil "~{~a~}" parts))
9:40:20
gabbiel
it just seems better to be able to glue as many things as I want like with (glue 1 2 3)
9:51:58
gabbiel
strings are a problem though, maybe I should drop strings since i dont have a use for them yet
9:51:58
pjb
gabbiel: you can use &rest in generic functions, but methods are not dispatched on other than mandatory arguments.
9:58:09
ggole
You could write glue2 with a generic function and then fold it over the argument list of a non-dispatching function
10:00:37
pjb
gabbiel: infering the type of the result is probably wrong. instead, pass the type of the result as first argument, like with concatenate or map.
10:33:02
pjb
gabbiel: notice that (glue 1 -2 3 -4) #| ERROR: The value #C(0.60206 1.3643763) is not of the expected type real. |#
10:34:31
pjb
gabbiel: (defun glue (&rest args) (with-output-to-string (*standard-output*) (mapc (function princ) args))) (glue 1 'two "three" 1 0 0 2 1 -2 3 -4) #| --> "1twothree10021-23-4" |#
10:36:05
pjb
gabbiel: what I'm saying is that your problem is not function or method, &rest or not. Your problem is to specify what you want.
10:36:43
gabbiel
it dawned on me that glue should literally glue it, so it follows that gluing integers and strings makes sense
10:45:27
gabbiel
I only came about this "glue" business to glue integers for a backtracking algorithm
10:46:17
gabbiel
i tried to extend gluing to symbols and strings, which arose ambiguity and design problems
11:04:19
pjb
gabbiel: glueing still doesn't mean anything. Why should (glue 12 34) return 1234 instead of say 802 ?
11:04:45
pjb
gabbiel: ie. why do you use the base ten textual representations and concatenate them, instead of the base two or something else?
11:05:27
pjb
gabbiel: obviously, you can define any arithmetic operation, but what meaning does that have?
11:17:53
jonatack
mrcode_: git grep 25519 from within the ironclad repository turns up tons of results... git grep is your friend ;)