I've now generalized this to be a function or a slot in the struct.

I hope to get it merged relatively soon.

Sam



On Sat, Jul 12, 2014 at 3:00 PM, J. Ian Johnson <i...@ccs.neu.edu> wrote:
> Why is it a name per type? That seems wrong, since a function with docstring 
> struct should have the object-name of the function, or something refined. The 
> struct itself could be used for potentially every function a user writes, 
> rendering object-name overly vague.
> -Ian
> ----- Original Message -----
> From: "Sam Tobin-Hochstadt" <sa...@cs.indiana.edu>
> To: "Matthew Flatt" <mfl...@cs.utah.edu>
> Cc: "Racket Users" <users@racket-lang.org>
> Sent: Saturday, July 12, 2014 2:44:09 PM GMT -05:00 US/Canada Eastern
> Subject: Re: [racket] something like a prop:object-name?
>
> This doesn't count as "soon", but I finally cleaned up my patch for
> this: https://github.com/plt/racket/pull/729
>
> It's not as general as what Alexander envisioned, so it should
> probably be generalized.
>
> Sam
>
> On Wed, Apr 30, 2014 at 5:13 PM, Sam Tobin-Hochstadt
> <sa...@cs.indiana.edu> wrote:
>> I've written 75% of a patch for this, so hopefully we'll have it soon.
>>
>> Sam
>>
>> On Wed, Apr 30, 2014 at 4:50 PM, Matthew Flatt <mfl...@cs.utah.edu> wrote:
>>> I think `prop:object-name` would be a good addition, but it doesn't
>>> exist right now.
>>>
>>> At Wed, 30 Apr 2014 16:35:06 -0400, "Alexander D. Knauth" wrote:
>>>> What do you mean?  I tried it and it didn’t affect the object-name.
>>>>
>>>> And what I’m looking for is something that could be different for different
>>>> instances of the same structure type, for example:
>>>> (struct thing (name) #:property prop:object-name (struct-field-index name))
>>>>
>>>> (struct proc-with-string (proc str)
>>>>   #:property prop:procedure (struct-field-index proc)
>>>>   #:property prop:object-name (lambda (this)
>>>>                                 (object-name (proc-with-string-proc this)))
>>>>   #:property prop:custom-write (lambda (this out mode)
>>>>                                  (display (proc-with-string-str this) 
>>>> out)))
>>>>
>>>>
>>>> On Apr 30, 2014, at 9:26 AM, Stephen Chang <stch...@ccs.neu.edu> wrote:
>>>>
>>>> > Does the #:extra-constructor-name keyword argument to struct do what 
>>>> > you're
>>>> looking for?
>>>> >
>>>> > On Apr 29, 2014 9:31 PM, "Alexander D. Knauth" <alexan...@knauth.org> 
>>>> > wrote:
>>>> > I’m just curious is there something like a prop:object-name that the
>>>> object-name function would use when returning the object name of a struct 
>>>> with
>>>> that property?
>>>> >
>>>> >
>>>> > ____________________
>>>> >   Racket Users list:
>>>> >   http://lists.racket-lang.org/users
>>>>
>>>> ____________________
>>>>   Racket Users list:
>>>>   http://lists.racket-lang.org/users
>>>
>>> ____________________
>>>   Racket Users list:
>>>   http://lists.racket-lang.org/users
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to