Search
Friday, 15th of June 2018, 1:22:59 UTC
2:10:26
akkad
and freenode, as defined by rob was for ## to be for the opensource, and # to not be
2:11:00
Bike
where did you hear that?
2:11:14
Bike
https://freenode.net/kb/answer/namespaces this thing says something else
2:11:24
akkad
umm... Freenode policy since rob converted from linpeople.org to freenode back in 99
2:24:19
akkad
how things have changed. Aug 02 15:30:47 2002 #lisp 67 The open source lisp-wiki: http://ww.telent.net/cliki/ - sbcl 0.7.6 out - clisp 2.29 out - new site: www.lispworks.com
3:21:54
beach
Good morning everyone!
4:15:36
LdBeth
Is it possible to specify type for certain symbols, e.g. for symbol 'YES and 'NO, they have type 'Y-OR-N
4:16:13
pillton
Sure: (typep 'yes '(member yes no))
4:16:55
pillton
Then you can use deftype to create 'y-or-n. (deftype y-or-n () '(member yes no))
4:21:17
LdBeth
So can I add or del symbols to that type defined
4:22:25
pillton
Absolutely. At runtime if you wish as well.
4:25:09
LdBeth
Seems I can use a function to check the type and then hack that function
4:26:01
pillton
What are you trying to do?
4:29:57
LdBeth
I want to write a TCG card game, there’s certain attributes I want to check if is valid at runtime and retain the ability adding new attributes
4:35:32
beach
It doesn't sound like using types would be good for situations like that.
4:37:39
LdBeth
beach: yes, so I use instance and do after initialize check currently
4:42:06
beach
LdBeth: Do you have some code to show us?
4:49:45
LdBeth
https://paste.ubuntu.com/p/THJPhMwm9v/
4:50:38
LdBeth
I use Fset for collections
4:53:00
beach
I see a lot of potential clashes with Common Lisp symbols.
4:53:11
beach
But I guess you shadow them in your package definition.
4:57:20
beach
And I guess I don't see the purpose of the new metaclass, but that's probably normal, since I don't understand what the code is doing.
5:03:20
LdBeth
beach: I use metaclass because I want to avoid introducing a lot of global variables. That additional slot of metaclass stores allowed content
5:07:32
LdBeth
(defdata foo '(a b c))
5:07:36
LdBeth
(make-instance 'foo :content a) ;; => valid
5:08:12
LdBeth
(make-instance 'foo :content 'g) ;; error
5:08:29
LdBeth
Umm, I missed a quote for a
5:09:46
DataLinkDroid2
** NICK DataLinkDroid
5:11:25
beach
Why can't that just be a slot with :allocation :class?
5:19:07
beach
Anyway, I should quit pestering you, since I don't really understand the code.
5:21:09
LdBeth
Never mind, just a personal interested project.
5:22:42
LdBeth
beach: I didn’t noticed :allocation. Seems to be a good idea
7:30:09
shka
does clrhash in sbcl actually frees the memory?
7:30:53
beach
... other than perhaps the fairly small amount of memory for the has table itself.
7:31:02
beach
But it probably doesn't bother.
7:31:18
beach
Otherwise, keys and values can be shared, so it can't free that memory.
7:50:40
shka
beach: well, maybe i should rephrase my question
7:51:11
shka
by freeing memory i thinked about hash-table-size
7:51:16
shka
but i can actually check that
7:51:36
beach
Oh, that's different.
7:52:11
shka
because it would not be different from making fresh hash-table
7:52:23
shka
besides maybe convinience
7:55:01
beach
And preserving identity.
7:55:58
jackdaniel
from the "under the hood" perspective it is different. clrhash mutates hashtable object, while creating fesh hash-table constructs whole new one
7:56:24
beach
That's what I meant by preserving identity.
7:56:31
jackdaniel
also if you have more references to that hashtable in your program, then clrhash will clear all of them
7:58:37
jackdaniel
s/all of them/"all of them"/
8:00:06
shka
but rehashing is killing me
8:00:37
shka
and I am sure that i won't need smaller hash-table
8:01:20
shka
so what bothers me are internals
8:04:00
jackdaniel
if you set integer as rehash size, then you should avoid frequent rehashing
8:04:11
jackdaniel
given I understand correctly your dillema
8:04:42
jackdaniel
(of you should know beforehand what this integer value should be)
8:09:26
shka
jackdaniel: that sounds reasonable
9:49:12
jmercouris
has anyone deployed a lisp webserver using apache?
9:49:24
jmercouris
rather, has anyone in this channel done so, or know of a guide illustrating how to do so?
9:51:28
thodg
jmercouris: yes with fastcgi
9:51:54
thodg
or you can proxy requests to hunchentoot
9:52:55
thodg
best is a reverse caching proxy for your app server
9:53:12
thodg
and nginx is perfect for that but apache works too
9:53:42
thodg
configuration should be the same for lisp or other app servers
9:58:14
jmercouris
thodg: Right fine, but what does the config look like?
9:58:53
jmercouris
maybe this is more of an apache question
9:59:12
thodg
yes, a search for "apache reverse caching proxy" should give good results
9:59:37
thodg
or just reverse proxy
9:59:52
thodg
but i don't know what kind of lisp endpoint you have
10:00:23
jmercouris
It's a caveman2 application
10:44:27
varjag
ok, got cl-http2-protocol running again, but servers refuse to negoitate to h2
10:44:41
varjag
guess at this point one has to learn nooks and crannies of http/2
11:42:55
flip214
does somebody know of a higher-level interface to Ethereum than https://github.com/tsikov/ethi? something like https://web3py.readthedocs.io/en/stable/contracts.html or so?
11:52:06
jmercouris
flip214: I believe there is a lisp version somewhere
12:53:40
jmercouris
can someone explain how (list 'quote 'foo) -> 'FOO ?
12:53:53
jmercouris
I imagine it would do (quote foo)
12:54:04
jmercouris
which I would thereafter imagine would become just FOO
12:55:00
jmercouris
because 'FOO is shorthand for (quote foo)
13:05:38
jmercouris
I have to say I really prefer (quote x) than 'x
13:05:57
shka
jmercouris: you will grow out of it
13:06:49
jackdaniel
left-parenthesis quote x right-parenthesis ; beats all ;)
13:07:01
jmercouris
you can type out left-parenthesis?
13:07:14
jmercouris
damnit, I just tried it in my repl lo
13:07:26
jmercouris
I guess one could define a macro
13:09:58
jmercouris
are symbols objects?
13:10:17
jmercouris
I was just wondering
13:10:21
jmercouris
it seems like they would be
13:11:02
jmercouris
is the function pointed to by a symbol stored in a slot of that symbol?
13:11:15
jackdaniel
symbol is a built-in class
13:11:45
jackdaniel
it means that it doesn't have to be a standard-class
13:11:47
jmercouris
when we assign a variable to a symbol, are we instantiating a new object of the class symbol?
13:12:20
phoe
assign a variable to a symbol?
13:12:26
phoe
variables have nothing to do with object instantiation
13:12:30
jackdaniel
built-in class means: we pretened it is a class, but in fact it is internal datatype with shoehoerned aspects allowing dispatch on it
13:12:44
jmercouris
jackdaniel: Ok, that is good to know, I'll put that in my notes thank you
13:12:46
phoe
symbols are usually created at read-time
13:13:04
jmercouris
well for example, when we enter a function body
13:13:09
jmercouris
we are assigning a symbol to some variable value
13:13:18
phoe
jmercouris: yes, but the symbols are already created by that time
13:13:19
jmercouris
like (defun funk (x) ...)
13:13:41
phoe
jmercouris: do you know how the REPL works?
13:13:45
phoe
and at which point what happens?
13:13:52
jmercouris
phoe: No, not really
13:13:59
Bike
"assigning a symbol" and "variable value" are both kind of meaningless
13:14:07
phoe
jmercouris: then do figure that out.
13:14:11
jmercouris
I've only read PCL which wasn't very helpful
13:14:21
jmercouris
I'm going cover to cover now on Gentle introduction to symbolic
13:14:29
phoe
at read-time, the string "(defun funk (x) ...)" gets turned into a list
13:14:46
phoe
the first element of that list is the symbol DEFUN that was not created, because it is already present in the CL package
13:15:03
phoe
the second element of that list is the symbol FUNK that is not standard, therefore it could have been created automatically at read-time
13:15:32
phoe
so you get a data structure after read-time - a list containing symbols, lists, whatever else
13:15:44
jmercouris
phoe: so, FUNK is instantiated at read-time?
13:15:50
phoe
jmercouris: the symbol? usually, yes
13:16:07
jmercouris
I see, so during run-time we are never evaluating new symbols?
13:16:14
Bike
you only create symbols at runtime if you have a call to cl:intern, or the like.
13:16:15
jmercouris
s/evaluating/instantiating
13:16:16
phoe
jmercouris: what do you mean, evaluating new symbols?
13:16:36
jmercouris
that makes sense now
13:16:39
phoe
you have to explicitly call MAKE-SYMBOL, GENSYM, GENTEMP, INTERN and so on
13:16:43
jmercouris
old code that I wrote is starting to make sense to me
13:16:45
phoe
to create symbols at runtime
13:16:49
jmercouris
I really did not understand what I was doing...
13:16:58
Bike
if you have, say, (defun funk (x) x), the symbol X probably exists at runtime only for debugging reasons. The actual code doesn't need it.
13:17:03
beach
jmercouris: The function may not be pointed to by the symbol, and the symbol may not have a slot containing such a pointer.
13:17:27
beach
jmercouris: As long as your implementation answers correctly to (symbol-function <symbol>) it can do what it wants.
13:17:56
jmercouris
so basically what jackdaniel said right? the implementation has latitude to implement the "symbol class" however it likes
13:18:09
Bike
it's related to what jackdaniel said, yes.
13:18:29
jackdaniel
have you ever doubted me? ;-)
13:18:47
jackdaniel
yes, I encounter it often. probably the way I speak.
13:18:48
Bike
there is an API. the API says you can use symbol-function to get the function named by the symbol in the global environment. the API does not say anything at all about how this is accomplished
13:19:07
Bike
because that's not a matter for an interface
13:19:57
jmercouris
I see, thanks for the information
13:21:22
beach
jmercouris: And, in fact, in SICL, the association between function names and functions is stored in a first-class global environment. That way, this association can be different in different environments.
Friday, 15th of June 2018, 13:22:59 UTC