-
-
Save eduardoleon/8c167e125ea2325ed85bc6b4deb05a47 to your computer and use it in GitHub Desktop.
Differences between ML and Lisp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pyon% poly | |
Poly/ML 5.8 Release | |
> datatype foo = Foo; | |
datatype foo = Foo | |
> val mine = Foo; | |
val mine = Foo: foo | |
> datatype foo = Foo; | |
datatype foo = Foo | |
> val yours = Foo; | |
val yours = Foo: foo | |
> mine = yours; | |
poly: : error: Type error in function application. | |
Function: = : ?.foo * ?.foo -> bool | |
Argument: (mine, yours) : ?.foo * foo | |
Reason: Can't unify ?.foo with foo (Different type constructors) | |
Found near mine = yours | |
Static Errors | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pyon% sbcl | |
This is SBCL 2.0.0, an implementation of ANSI Common Lisp. | |
More information about SBCL is available at <http://www.sbcl.org/>. | |
SBCL is free software, provided as is, with absolutely no warranty. | |
It is mostly in the public domain; some portions are provided under | |
BSD-style licenses. See the CREDITS and COPYING files in the | |
distribution for more information. | |
* (defclass foo () ()) | |
#<STANDARD-CLASS COMMON-LISP-USER::FOO> | |
* (defvar my-foo (make-instance 'foo)) | |
MY-FOO | |
* (defclass foo () ()) | |
#<STANDARD-CLASS COMMON-LISP-USER::FOO> | |
* (defvar your-foo (make-instance 'foo)) | |
YOUR-FOO | |
* (eq (class-of my-foo) (class-of your-foo)) | |
T | |
* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment