You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5362 Reporter: Dmitry Grebeniuk Assigned to:@mshinwell Status: resolved (set by @mshinwell on 2016-12-12T16:01:44Z) Resolution: fixed Priority: normal Severity: feature Version: 3.12.1 Category: ~DO NOT USE (was: OCaml general) Monitored by:@ygrek "Julien Signoles"
Bug description
"let _ : t = v" should be accepted just like "let x : t = v" even without camlp4o:
$ ocaml
Objective Caml version 3.12.1+rc1
let x : int = 1;;
val x : int = 1
let _ : int = 1;;
Error: Syntax error
#use "topfind";;
: unit = ()
Findlib has been successfully loaded. Additional directives:
#require "package";; to load a package
#list;; to list the available packages
#camlp4o;; to load camlp4 (standard syntax)
#camlp4r;; to load camlp4 (revised syntax)
#predicates "p,q,...";; to set these predicates
Topfind.reset();; to force that packages will be reloaded
#thread;; to enable threads
: unit = ()
#camlp4o;;
/home/gds/dev/ovm/ocaml/lib/dynlink.cma: loaded
/home/gds/dev/ovm/ocaml/lib/camlp4: added to search path
/home/gds/dev/ovm/ocaml/lib/camlp4/camlp4o.cma: loaded
Camlp4 Parsing version 3.12.1+rc1
let x : int = 1;;
val x : int = 1
let _ : int = 1;;
: int = 1
Also it's strange that toplevel output ("- : int = 1") differs from revised syntax:
$ ocaml
Objective Caml version 3.12.1+rc1
#use "topfind";;;
: unit = ()
Findlib has been successfully loaded. Additional directives:
#require "package";; to load a package
#list;; to list the available packages
#camlp4o;; to load camlp4 (standard syntax)
#camlp4r;; to load camlp4 (revised syntax)
#predicates "p,q,...";; to set these predicates
Topfind.reset();; to force that packages will be reloaded
#thread;; to enable threads
: unit = ()
#camlp4r;;
/home/gds/dev/ovm/ocaml/lib/dynlink.cma: loaded
/home/gds/dev/ovm/ocaml/lib/camlp4: added to search path
/home/gds/dev/ovm/ocaml/lib/camlp4/camlp4r.cma: loaded
Camlp4 Parsing version 3.12.1+rc1
value _ : int = 1;
(there is no output at all)
The text was updated successfully, but these errors were encountered:
Yes, you are right.
So, please treat this issue not as "bug report", but as a "feature wish".
It's very convenient to think about "_" pattern as "/dev/null variable", "sink variable", "value that is will be bound to anything you'll bind it to". So, I personally like the #camlp4o and #camlp4r behaviour. However, I'm using revised syntax almost always, so this issue will cause inconvenience/misunderstanding only for "plain toplevel users".
Original bug ID: 5362
Reporter: Dmitry Grebeniuk
Assigned to: @mshinwell
Status: resolved (set by @mshinwell on 2016-12-12T16:01:44Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 3.12.1
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @ygrek "Julien Signoles"
Bug description
"let _ : t = v" should be accepted just like "let x : t = v" even without camlp4o:
$ ocaml
Objective Caml version 3.12.1+rc1
let x : int = 1;;
val x : int = 1
let _ : int = 1;;
Error: Syntax error
#use "topfind";;
: unit = ()
Findlib has been successfully loaded. Additional directives:
#require "package";; to load a package
#list;; to list the available packages
#camlp4o;; to load camlp4 (standard syntax)
#camlp4r;; to load camlp4 (revised syntax)
#predicates "p,q,...";; to set these predicates
Topfind.reset();; to force that packages will be reloaded
#thread;; to enable threads
: unit = ()
#camlp4o;;
/home/gds/dev/ovm/ocaml/lib/dynlink.cma: loaded
/home/gds/dev/ovm/ocaml/lib/camlp4: added to search path
/home/gds/dev/ovm/ocaml/lib/camlp4/camlp4o.cma: loaded
Camlp4 Parsing version 3.12.1+rc1
let x : int = 1;;
val x : int = 1
let _ : int = 1;;
Also it's strange that toplevel output ("- : int = 1") differs from revised syntax:
$ ocaml
Objective Caml version 3.12.1+rc1
#use "topfind";;;
: unit = ()
Findlib has been successfully loaded. Additional directives:
#require "package";; to load a package
#list;; to list the available packages
#camlp4o;; to load camlp4 (standard syntax)
#camlp4r;; to load camlp4 (revised syntax)
#predicates "p,q,...";; to set these predicates
Topfind.reset();; to force that packages will be reloaded
#thread;; to enable threads
: unit = ()
#camlp4r;;
/home/gds/dev/ovm/ocaml/lib/dynlink.cma: loaded
/home/gds/dev/ovm/ocaml/lib/camlp4: added to search path
/home/gds/dev/ovm/ocaml/lib/camlp4/camlp4r.cma: loaded
Camlp4 Parsing version 3.12.1+rc1
value _ : int = 1;
(there is no output at all)
The text was updated successfully, but these errors were encountered: