Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSCL issue: sequence-definition #50

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jcguu95
Copy link

@jcguu95 jcguu95 commented May 17, 2024

In the draft ANSI Common Lisp specification, the description of the system class SEQUENCE conflicts with the description of the Sequence Concepts. This issue fixes the conflict.

@jcguu95 jcguu95 changed the title Issue: sequence-definition WSCL issue: sequence-definition May 17, 2024
wscl-issues/draft/sequence-definition Outdated Show resolved Hide resolved

Test Cases:

N/A (Test cases are difficult to provide, because conformating
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(subtypep 'sequence '(or vector list)) could return T NIL or NIL NIL on an implementation conforming to this proposal, but NIL T would indicate nonconformance.

Also: "conforming"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this.. For a conforming implementation, we do need (subtypep '(or vector list) 'sequence) to return T T. However, the point of this issue is to give such an implementation the freedom to have something else in the type sequence.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You read the arguments backwards. I'm saying you can test whether sequence is a subtype of (or vector list), not the other way around. If any non-list non-vector sequences are possible, sequence is not a subtype of (or vector list).

Of course I suppose this proposal doesn't necessarily require implementations to have non-vector non-list sequences, so maybe the subtype is inappropriate after all. Considered that way, having test cases at all would be inappropriate, since it's just making the standard more flexible without requiring any implementation to make any changes whatsoever.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still confused. Why would (subtypep 'sequence '(or vector list))'s returning NIL T indicate nonconformance to this proposal? This proposal aims to provide the freedom for an implementation to have sequence to possibly have things more than just vectors and lists.

Copy link
Member

@yitzchak yitzchak May 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A value of NIL, T or NIL, NIL indicates the implementation does not conform to the current [b].

For this issue, the test cases would not indicate conformance or non-conformance, but indicate whether LIST and VECTOR are exhaustive for the typespace of SEQUENCE. Supporting extensible sequences would require returning NIL, T, I would think.

Test Cases:

  (defun one ()
    (subtypep 'sequence '(or vector list)))

  (one) ; => T, T

Rationale:

  This is a plain contradiction in dpANS.

Current Practice:

  ABCL 1.9.3-dev-fasl43
    (one) ; => NIL, NIL

  SBCL 2.4.1
    (one) ; => NIL, T

  CLASP cclasp-boehmprecise-2.5.0-247-g4b148619f-g85ffab47-cst
    (one) ; => T, T

  ECL 23.9.9-f477a3ef
    (one) ; => T, T

  CMU 2024-03-10 18:28:32 (21E Unicode)
    (one) ; => T, T

  CCL 1.12-f98
    (one) ; => T, T

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants