pharo-vm icon indicating copy to clipboard operation
pharo-vm copied to clipboard

Avoid name collisions on C code

Open PalumboN opened this issue 1 year ago • 1 comments

  • [ ] Avoid two functions with the same name -> remane. If both are <api> then throw an error.
  • [ ] Same name in local variable names and functions. We can rename the local variables using _ prefix.

PalumboN avatar Jun 23 '23 14:06 PalumboN

Right now:

  • Having two methods blah and blah: (no-accessors of a struct) generates two functions with the same name -> Fail C compilation.
  • Defining a method like:
algo
	| setupStack |
	setupStack := 6.
	self setupStack: 5.
	^ setupStack

Fails because local variable and message send are translated with the same name

PalumboN avatar Jun 23 '23 14:06 PalumboN