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

Feature wish: (::) or cons #3261

Closed
vicuna opened this issue Mar 15, 2002 · 1 comment
Closed

Feature wish: (::) or cons #3261

vicuna opened this issue Mar 15, 2002 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Mar 15, 2002

Original bug ID: 1014
Reporter: administrator
Status: closed (set by @xavierleroy on 2006-06-17T09:27:41Z)
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Pierre Letouzey
Version: 3.04
OS: linux
Submission from: pc8-119.lri.fr (129.175.8.119)

I am looking for a convenient way of using the list constructor
as any other constructors, i.e. in a prefix way.

  • By analogy with the infix functions like (+) 3 5, I first though of
    the syntax (::) (3,[]) but it seems not to be allowed.

  • If I define an alias like "let cons (a,l) = a::l", then I can't use it in a
    pattern matching.

I acknowledge that the infix :: syntax is almost always ok, but in my
particular
it could be useful to have also a prefix one. I do automatic generation of
ocaml
code from Coq terms, and this particular case is a bit annoying.

If (::) or a primitive Cons alias could be done, then thank you. If not, never
mind...

Pierre Letouzey

@vicuna
Copy link
Author

vicuna commented Jun 17, 2006

Comment author: @xavierleroy

Feature implemented in 3.09.0

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

No branches or pull requests

1 participant