Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
The compiler can't distinguish proc from field when both identifiers have the same name. I tried compiling the provided example with a func and method instead of proc. Still fails.
To reproduce
type Status = object
response: string
proc response(s: var Status, r: string) =
s.response = r
var s: Status
s.response("stoof")
Current Output
~ $ nim cc .\main.nim
Hint: used config file 'C:\Program Files\Nim\config\nim.cfg' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: main [Processing]
Error: in expression 's.response("stoof")': identifier expected, but found 's.response'
Expected Output
~ $ nim cc .\main.nim
Hint: used config file 'C:\Program Files\Nim\config\nim.cfg' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: main [Processing]
CC: stdlib_system.nim
CC: main.nim
Hint: [Link]
Hint: 14208 LOC; 0.833 sec; 16.133MiB peakmem; Debug build; proj: ~\Downloads\main.nim; out: ~\Downloads\main.exe [SuccessX]
Additional Information
~ $ nim -v
Nim Compiler Version 1.2.6 [Windows: amd64]
Compiled at 2020-07-29
Copyright (c) 2006-2020 by Andreas Rumpf
git hash: bf320ed172f74f60fd274338e82bdc9ce3520dd9
active boot switches: -d:release
The compiler can't distinguish proc from field when both identifiers have the same name. I tried compiling the provided example with a
func
andmethod
instead ofproc
. Still fails.To reproduce
Current Output
Expected Output
Additional Information