freenode/#lisp - IRC Chatlog
Search
6:00:20
manualcrank
many times though i'm content to just use READ because the input is always correct and there isn't enough to make a difference
6:03:06
manualcrank
for me, no, speed is irrelevant as long as the code produces the correct answer in the allotted time
6:06:40
manualcrank
i'm doing these problems on a core 2 duo from over a decade; it's always fast enough for me
6:07:55
manualcrank
some sites have a clojure option (not kattis) and that's hopeless because none of the code ever completes
6:09:42
manualcrank
but clojure is fast once it starts up; it's just not fast enough to verify your algorithm is correct on these sites
6:11:36
LdBeth
But u should always be notified the thing gets verified is the model rather than the actual code
6:13:48
manualcrank
every problem is a script that compares your output with the correct output furnished by the problem writer
6:17:31
LdBeth
If the output mismatch, there’s high probability something is wrong, but the reverse is not true
6:22:17
manualcrank
none terminating programs are terminated after they exceed the time limit (1 sec typically)
6:23:57
LdBeth
What if the program is a compiler that requires long time and a lot amount of space for execution
6:30:12
manualcrank
identifying the correct string matching algorith, graph algorithm, computational geometry algorithm, etc.
6:31:08
manualcrank
it's never the fastest language (every problem has a statistics link) but neither is it the slowest
6:33:00
manualcrank
Java is fast enough though, i mean it doesn't TLE unless your algorithm is wrong
7:00:31
ck_
http://www.acm.org/pubs/articles/journals/cacm/1999-42-10/p109-prechelt/p109-prechelt.pdf
7:03:12
no-defun-allowed
figure i don't get access to it since i don't pay ACM the big kahoonas, nor does sci-hub work for it
7:05:19
ck_
sorry about that. Try this: https://trs.jpl.nasa.gov/bitstream/handle/2014/14462/00-0900.pdf?sequence=1
7:07:22
ck_
if you like, also take a look at norvig.com/java-lisp.html , which is Peter Norvig's solution to the problem used in the study
9:17:55
dmiles
#S is generally for "structures" .. though this would be OK.. #S(HASH-TABLE :TEST EQL :SIZE 120 :CONTENTS (1 ONE 2 TWO)) Does that mean the HASH-TABLE needs to be a structure-p ?
9:23:59
jackdaniel
if it is printed as something else then it is something else. I think that it is not specified what is a class of hash-table (i.e it may be built-in-class, structure-class etc)
9:25:20
loke
About #S “...denotes a structure. This is valid only if name is the name of a structure type already defined by defstruct and if the structure type has a standard constructor function.”
9:31:44
dmiles
i was sort of hoping to reuse #S for ptrint readable of standard classes but i suppose i will choose another then
9:36:43
jackdaniel
also, if we believe it, than it would mean: if standardized notation is defined for hash-tables that means that hash tables are structures (what would be conforming)
9:37:15
dmiles
clisp> (class-of #S(HASH-TABLE :TEST EQL :SIZE 120)) ==> #<BUILT-IN-CLASS HASH-TABLE>
9:38:18
loke
It seems CLISP has implemented an extension based on the example. but the example is arguably incorrect.
9:45:19
dmiles
#.(let ((ht (MAKE-HASH-TABLE :TEST EQL :SIZE 120))) (setf (gethash 'ONE table) 1) (setf (gethash 'TWO table) 1) ht)
9:47:24
loke
*PRINT-READABLY* is not guaranteed to write a readable hashtable. And even if it does, it's not compatible across implementations.
9:52:32
jmercouris
is there a way in paredit to transform (("a" "b") ("c" "d")) to (("c" "d") ("a" "b"))?
9:54:41
loke
jmercouris: It's not a paredit function by the way. it work equally well outside parwedit (the function is command-transpose-sexps)
9:54:58
dmiles
for some objects that i really cant print readably i might do #.(nth 666 *this-instance-instances*)
9:58:10
loke
fivo: that, and dont put any closing parens on separate lines. The only valid excuse is if it's a vertical list of objects and the last line ends with a line comment.
10:01:45
fivo
I asking because I was wondering how an macro with only a &body argument would be indented.
10:03:36
loke
fivo: SLIME is clever enough to notice that the macro has a &body argument and indents accordingly
10:18:51
loke
fivo: if the definition of $ uses an entire &body, then SLIME would not format it like that. But I don't know how it's defined.
10:23:03
flip214
Is there a definition whether (CHANGE-CLASS instance 'new-class :slot "value") has to change the slot's value if instance is already of class 'new-class?
10:35:57
flip214
beach: so you think a CHANGE-CLASS to the same class is _defined_ to be a no-op too? Thanks a lot.
10:36:35
flip214
I'm not sure about "After completing all other actions, change-class invokes update-instance-for-different-class"
10:41:19
beach
I don't see anything specifically said about that. You may have to consider both possibilities.
10:43:52
flip214
Well, in absence of a CDR the behaviour is undefined, and so I can just wish for the more performant, right? ;)
14:10:20
fiveop
I need a name for a function that closes over a function adding a number of ignored arguments to the back of the argument list. Sort of an inverse-curry.
14:12:27
fiveop
going by everyday language with-ignored-args would be good, but would not match the common usage of the with-.. pattern
15:27:15
TMA
fiveop: haskell has 'const' for something similar. (const .) is for 'ignore second argument', ((const .) .) is for 'ignore third'... there are no variadics in haskell though
15:30:47
TMA
fiveop: in general, keeping M and ignoring N arguments is constructed by composing N consts and then wrapping in M ( .)'s
17:00:19
fiveop
TMA: but nothing is (necessarily) constant. it's just that the arguments passed by whatever API the function is passed to, are not of interest.
17:32:48
flip214
I just shot my swank connection... close-connection: The value 24009213 is not of type (UNSIGNED-BYTE 24) when binding COMMON-LISP:LENGTH ...