Difference between deftype in Common Lisp and schema

I am trying to translate Common Lisp code into schema code. Generic Lisp code has deftype. Are they the deftypesame as deftypein Common Lisp? How do you translate deftypein Common Lisp to equivalent code in Schema?

+3
source share
2 answers

According to Anton, there is no exact scheme equivalent to Common Lisp deftype. See CLHS: Type Specifiers for a description of what a type specifier can be in Common Lisp. They are used in declarations, array type specifications, structure slot and CLOS specifications, specialization of universal function arguments, and so on. Porting this to a circuit will usually be a monumental task. Your best hope is that types defined deftypeare only used trivially (or not at all!).

+3
source

Generic Lisp deftypedo not have the exact equivalent of Schema. You will have to translate the type definitions manually or write a macro deftypein terms of any library of schema records available on your system.

Bare Scheme . R5RS SRFI (, SRFI-9 ( ), SRFI-57 Records, SRFI-99 ERR5RS), , SRFI , ; -, . R6RS .

+1

Source: https://habr.com/ru/post/1714640/


All Articles