Enable refering to ->type inside deftype

Description

Inside a defrecord body it's possible to refer to ->type-ctor but that is not possible inside deftype.

This patch adds an implicit declare, as done in defrecord making it possible to use the ->type-ctor inside deftype methods

Environment

None

Activity

Show:
Timothy Baldridge
December 3, 2012, 5:29 PM

Seems valid. Vetting.

import
August 9, 2016, 4:34 PM

Comment made by: samestep

Will this be incorporated soon? It's awkward to have to explicitly declare the factory function when defining, e.g., data structures (example). Also, the current situation violates the principle of least astonishment; while working through this tutorial, I was quite surprised to find that defrecord does implicitly declare the factory functions, which contradicted my prior experience with deftype.

Alex Miller
August 10, 2016, 1:34 AM

No enhancements are considered critical so it's hard for me to say when this will get evaluated. I've bumped it one step down the process at least.

import
August 10, 2016, 1:39 AM

Comment made by: samestep

Thank you, Alex! I completely understand that this isn't a particularly important issue; nonetheless, it is encouraging to see it move closer to being fixed.

Assignee

Unassigned

Reporter

Nicola Mometto

Labels

Approval

Triaged

Patch

Code

Priority

Trivial