Skip to content

Types Posn and PosnOf #258

@bugcounting

Description

@bugcounting

In the student languages' signature (type) annotations, a
define-struct with name struct also defines signature forms
Struct and StructOf. For example:

(define-struct name [first last])

; name-full inputs instances of `name` where both fields are strings
(: name-full ((NameOf String String) -> String))
(define (name-full n) (string-append (name-first n) " " (name-last n)))

; the constructor of `name` returns an instance of type `Name`
(: make-name (Any Any -> Name))

In the student languages, there is a predefined struct called
posn. However, the type names Posn and PosnOf are not
defined. Can we provide these definitions as part of the student
languages?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions