Skip to content

instantiate should be replaced with make-object or new when feasible #418

@jackfirth

Description

@jackfirth
#lang resyntax/test

test: "insantiate without positional arguments refactorable to new"
--------------------
#lang racket
(define (f cls x y)
  (instantiate cls () ([x x] [y y])))
--------------------
--------------------
#lang racket
(define (f cls x y)
  (new cls ([x x] [y y])))
--------------------

When instantiate is used without positional arguments, it's equivalent to new. When used without by-name arguments, it's equivalent to make-object. Mixing the two is complicated and uses of instantiate that don't need to mix them should be refactored to one of the two simpler object creation forms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    new lintIssues suggesting new lints or pull requests implementing new lints

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions