Hi

 

Has something changed with transparency of structs?

I find the following:

 

#lang racket/base

 

(module a racket/base

(define inspector (make-inspector))

(define-values (descr constr pred acc mut)

  (make-struct-type 's #f 2 0 #f '() inspector #f '(0)))

(define an-s (constr 'monkey 'lion))

(provide an-s))

 

(module b racket/base

(define inspector (make-inspector))

(struct s (f g) #:inspector inspector)

(define another-s (s 'monkey 'lion))

(provide another-s))

 

(require 'a 'b)

 

(define (print-info s)

(printf "s = ~s~n" s)

(printf "struct? ~s~n" (struct? s))

(define-values (descr skipped?) (struct-info s))

(define-values (name n m ref set immut super skip) (struct-type-info descr))

(printf "ref : ~s~n" (ref s 0)))

 

(print-info an-s)

(print-info another-s)

 

Produces:

                                           

s = #(struct:s monkey lion)

struct? #t

ref : monkey

s = #(struct:s monkey lion)

struct? #t

ref : monkey

 

I expected for example (struct? an-s) to yield #f.

What am I confusing?

Thanks, Jos


This email has been scanned by BullGuard antivirus protection.
For more info visit www.bullguard.com
<http://www.bullguard.com/tracking.aspx?affiliate=bullguard&buyaffiliate=smt
p&url=/> 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/000801d564eb%24748c1f90%245da45eb0%24%40gmail.com.

Reply via email to