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: 7728 Reporter: vanto Status: resolved (set by @xavierleroy on 2018-02-17T18:12:57Z) Resolution: duplicate Priority: normal Severity: minor Version: 4.06.0 Category: compiler driver Duplicate of:#7727
Bug description
If a line has three semicolons, there is an error. If it has four semicolons, there is no error. And so on, there is an error for semicolons that are odd number and no error for semicolons that are even number.
example:
let a = 12;; (* OK )
let a = 12;;; ( error )
let a = 12;;;; ( OK )
let a = 12;;;;; ( error )
... and so on.
Likewise,
let a = 12;;12 ( Error: This expression has type int
This is not a function; it cannot be applied. )
let a = 12;;12;; ( OK )
let a = 12;;12;;; ( Error: Syntax error )
let a = 12;;12;;;; ( OK *)
... and so on.
This does not seem to disturb the compilation and does not seem to
represent a potential danger.
The text was updated successfully, but these errors were encountered:
I do not want to be a pain for everyone. The goal was to show that we should not confuse "do nothing" with "no operation" as the NOP mnemonic microprocessors.
I tested about 20000 lines of code, compiled into an executable file, with only two semicolons on each line. At runtime, knowing that the processor power was between up to 3%, in less than a second the file generated a microprocessor power ranging from 50% to more than 70%, and then stabilize around 3%.
A "no operation" (NOP) takes less power. Although it may be useful in certain circumstances, as demonstrated by a developer, it does not mean "do nothing".
I only want to say that in Caml Light this generates an error. Today the syntax of OCaml is no longer the same as Caml Light, this is called the evolution of language. Something else, these two semicolons could become, perhaps, a security problem for the future, and this syntax given to these semicolons seemed to me to become a bug later. Maybe this concept is to be reviewed for improvement?
Sorry if I hurt someone.
Original bug ID: 7728
Reporter: vanto
Status: resolved (set by @xavierleroy on 2018-02-17T18:12:57Z)
Resolution: duplicate
Priority: normal
Severity: minor
Version: 4.06.0
Category: compiler driver
Duplicate of: #7727
Bug description
If a line has three semicolons, there is an error. If it has four semicolons, there is no error. And so on, there is an error for semicolons that are odd number and no error for semicolons that are even number.
example:
let a = 12;; (* OK )
let a = 12;;; ( error )
let a = 12;;;; ( OK )
let a = 12;;;;; ( error )
... and so on.
Likewise,
let a = 12;;12 ( Error: This expression has type int
This is not a function; it cannot be applied. )
let a = 12;;12;; ( OK )
let a = 12;;12;;; ( Error: Syntax error )
let a = 12;;12;;;; ( OK *)
... and so on.
This does not seem to disturb the compilation and does not seem to
represent a potential danger.
The text was updated successfully, but these errors were encountered: