freenode/#clasp - IRC Chatlog
Search
4:08:48
drmeister
https://llvm.org/doxygen/classllvm_1_1DWARFContext.html#a3dc5679c9f87dbde396b2ef8e006bc14
4:09:55
Bike
and then from the DILocal you get the FrameOffset, which is where the value is in the frame? i guess?
4:13:35
drmeister
If we exposed a function to gather this info and turn it into lisp values - voila - we are looking into C++ frames.
6:45:50
drmeister
It's in a Clasp function for reading C++ objects - I'll have to dive deeper tomorrow.
10:00:03
paulapatience[m]
drmeister: for what it's worth, I tried the demo after compiling clasp with the same version as you (commit hash 1ed44ec70) and the problem remains: http://ix.io/2gAV
11:52:47
kpoeck
eclector does not have a #i definition - how could it - so we still use core::sharp-!-reader
11:54:58
kpoeck
https://github.com/clasp-developers/clasp/blob/dev/src/lisp/kernel/cleavir/activate-clasp-readtables-for-eclector.lisp#L52
11:57:10
kpoeck
Is the call `(LOAD-CXX-OBJECT BOND (:A2 NIL) (:A1 NIL) (:ORDER . :SINGLE-BOND))` kosher?
12:22:36
scymtym
kpoeck: i added the fix for accepting string designators as slot names in #S from my other branch to the wip-reader-implementation-documentation branch in s-expressionists/eclector
14:31:51
kpoeck
(defun core::read-cxx-object (stream char n) (declare (ignore char n)) (let ((description (read stream t nil t))) (apply 'make-instance (car description) (cdr description))))
14:37:55
Bike
in particular, if it has to do with cxx object fixups substiting a standard instance might not reflect the issue
15:04:10
kpoeck
and woudn't it be nice if (read-from-string (with-output-to-string (*standard-output*) (core::print-cxx-object (make-hash-table) *standard-output*))) worked?
15:08:13
kpoeck
That works #I(CORE:HASH-TABLE-EQL (CORE:REHASH-SIZE . 2.0) (core:REHASH-THRESHOLD . 0.7)(core:data . nil))
15:11:05
drmeister
#i(CHEM:MOLECULE (:CONTENTS . #A(COMMON-LISP:T (1) (#i(CHEM:RESIDUE (:CONTENTS . #A(COMMON-LISP:T (2) (#1=#i(CHEM:ATOM (:NAME . :C1) (:BONDS . #A(COMMON-LISP:T (1) (#2=#i(CHEM:BOND (:A2 . #3=#i(CHEM:ATOM (:NAME . :C2) (:BONDS . #A(COMMON-LISP:T (1) (#2#))) (:HYBRIDIZATION . :SP?) (:ELEMENT . :C))) (:A1 . #1#) (:ORDER . :SINGLE-BOND))))) (:HYBRIDIZATION . :SP?) (:ELEMENT . :C)) #3#))) (:NAME . :R) (:UNIQUE-LABEL)))))
15:11:35
kpoeck
as does (progn #1=2.0 #2=0.7 #I(CORE:HASH-TABLE-EQL (CORE:REHASH-SIZE . #1#) (core:REHASH-THRESHOLD . #2#) (core:data . nil)))
15:19:38
drmeister
Sure. Give me a sec - I'm putting a few changes into the void Bond_O::fields method...
15:40:37
Bike
so if we use the eclector reader with the eclector ##/#= reader macros on cxx objects, it can't possibly work, right?
15:41:11
drmeister
Soon - I'm going through my usual edit-compile-error-edit-compile-error cycle with C++.
15:41:32
drmeister
You probably spotted several compiler errors in the code above - let alone runtime errors (sigh).
15:43:25
Bike
https://github.com/clasp-developers/clasp/blob/dev/src/lisp/kernel/lsp/sharpmacros.lsp#L53-L56 so put this bit in a FIXUP method?
15:45:53
drmeister
Can you tell me how this works? There needs to be an eclector.reader:fixup method for cxx-objects?
15:46:18
Bike
I think uI figured FIXUP is basically eclector's equivalent to the circle-subst function i linked
15:46:51
Bike
when you read an object with ## in it, you create an actual object but stuff circularity markers in; they you iterate through the object with circle-subst or fixup replacing them.
15:47:42
drmeister
I see - so the circle-table argument in (make-record-patcher circle-table) needs to be dealt with somehow.
15:48:11
drmeister
This reader fixup stuff is like thermodynamics. I learn it and forget it over and over and over again.
15:48:20
Bike
i don't know how fixup works, but i imagine it can't be that much different from what clasp does itself
15:48:44
drmeister
It can't be. I'll start by looking at my make-record-patcher and what it needs...
15:50:51
drmeister
The Bonds_O::fields method does four different things depending on what the Record_sp argument is.
15:51:10
drmeister
It writes out data, reads in data, initializes the object and patches the fields in the object.
15:51:28
kpoeck
We need the equivalent of https://github.com/s-expressionists/Eclector/blob/wip-reader-implementation-documentation/code/reader/fixup.lisp#L28-#L32
15:51:43
drmeister
kpoeck: I'm not making any changes - I'm just trying to blow dust off my neurons.
15:53:22
drmeister
(ECLECTOR.READER:FIXUP #<ECLECTOR.READTABLE::CLASP-NON-CST-ELECTOR-CLIENT> #<MOLECULE :M 0> #<HASH-TABLE-EQ :COUNT 0 :SIZE 16 @0x12c94ba58> #<HASH-TABLE-EQ :COUNT 3 :SIZE 16 @0x12c94ba08>)
15:56:26
Bike
circle-table looks more like the seen table. you can tell, since circle-subst only puts in T as values.
15:57:18
drmeister
kpoeck: I use this everywhere. I think the class will be something very generic...
15:59:23
drmeister
We can't iterate over them. We have to use the Record_O facility and the 'fields' method.
16:00:06
drmeister
So we have to convert the arguments of eclector.reader:fixup into a circle-table and pass that to core:make-record-patcher.
16:01:24
drmeister
Here - I'll cook something up - but it will have a problem that I don't know how to solve at the moment...