[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC] Getting rid of `def'
From: |
Jose E. Marchesi |
Subject: |
[RFC] Getting rid of `def' |
Date: |
Sat, 07 Nov 2020 15:03:15 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Hi people!
While discussing about another issue in irc, the possibility of getting
rid of the `def' prefix was raised.
Right now, we have the following language constructs that define things:
defvar foo = ...;
defun foo = ...;
deftype foo = ...;
defunit foo = ...;
And I plan to introduce yet another one, for sets (like enums and
bitmasks):
defset foo = ...;
Originally, I adopted `defun' from lisp, and just followed the same
trend for the other constructions in order to keep coeherence. However,
now I am wondering if it wouldn't be better to shorten these names to:
var foo = ...;
fun foo = ...;
type foo = ...;
unit foo = ...;
set foo = ...;
I can see a couple of advantages:
a1) It would shorten the size of programs, and also make them easier to
read.
a2) Since Poke is used interactively, having shorter names is a plus.
And one little disadvantage:
d1) The identifiers `var', `fun', `type', `unit' and `set' would all
become keywords in the language, and some of them are natural names
for variables.
At this point I feel that the advantages of changing the keywords
overweight the disadvantages, but I would like to hear what you people
think?
As with other important modifications to the language, this is the time
to adopt them, before we release :)
Salud!
- [RFC] Getting rid of `def',
Jose E. Marchesi <=