<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16414" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>(define-struct structure1 (f1))<BR>(define-struct structure2 (f1
f2))<BR>(define x (make-structure1 1))<BR>(define y (make-structure2 'a
'b))</DIV>
<DIV> </DIV>
<DIV>(define (f x)<BR> (printf "Name of structure ~a~n"<BR>
(regexp-replace* ".*<struct:|>$" (format "~s" x) "")))</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>(((((lambda(x)((((((((x x)x)x)x)x)x)x)x))<BR>
(lambda(x)(lambda(y)(x(x y)))))<BR> (lambda(x)(x)x))<BR>
(lambda()(printf "Greetings, Jos~n"))))</DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=wwall@yandex.ru href="mailto:wwall@yandex.ru">wwall</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=plt-scheme@list.cs.brown.edu
href="mailto:plt-scheme@list.cs.brown.edu">plt-scheme</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, April 11, 2007 9:42
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [plt-scheme] How get name of
structure</DIV>
<DIV><BR></DIV>Hello plt-scheme,<BR>i have this code:<BR><BR>(define-structure
structure1 (f1))<BR>(define-structure structure2 (f1 f2))<BR>(define x
(make-structure1 1))<BR>(define y (make-structure2 'a 'b))<BR><BR>(define (f
x)<BR>(display (format "Name of structure ~a \n" (??? x))))<BR><BR>;call
f<BR>(f x)<BR>(f y)<BR>want what will be printed<BR>"Name of structure
structure1"<BR>"Name of structure structure2"<BR><BR>what i must write
on place "???"<BR>now i write so<BR>(define (??? x) (string->symbol
(substring (symbol->string (vector-ref (struct->vector x) 0)
) 12)) )<BR>but think what exists simply method<BR><BR><BR>Thanks<BR>--
<BR>Best
regards,<BR> wwall
<A
href="mailto:wwall@yandex.ru">mailto:wwall@yandex.ru</A><BR><BR>_________________________________________________<BR>
For list-related administrative tasks:<BR> <A
href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</A><BR></BLOCKQUOTE></BODY></HTML>