More feature requests, or is it syntax?

new topic     » topic index » view thread      » older message » newer message

I haven't touched Pascal for... several weeks now. I am
writing a text parser in Euphoria, and hitting upon the
same syntactic quirks, time and again.

1. No local constants. Often I have a need for constants
   local to a function or procedure. Sure, there is a
   way around it: declare them in an "include" file, but
   that is a kludge.

2. I find myself having to initialize a large number of
   local variables by hand. An extension of the syntax
   of declarations like this would be wonderful:

   atom posSubject=0, posVerb=0, posObject=0
   sequence subject="", clause={}

3. This is half-baked, but... it's function versus procedure
   again. I find myself writing:

   dic=dicAddItem(dic,thisWord)

   It gets rather intricate (and tedious) when a function
   modifying the dictionary calls another modifying the
   same dictionary which calls... you know.

   In fact, there are two types of procedures and of functions
   in Euphoria: I/O functions and the rest, I/O procedures and
   the rest.

   In I/O functions and procedures *only* the first parameter is
   called by reference (file open in "write" or "update" mode),
   or by value (file open in "read" mode). The rest are always
   called by values.
   In other functions and procedures, ALL parameters are called
   by value, including the first.
   Would it not be better to generalize to all functions and
   procedures this distinction    which applies only to I/O?
   How to do it best syntactically, I don't know. Me, I'd
   merely use square brackets when parameters are passed by
   reference, and parentheses when they're passed by value.
   So that the same function/procedure identifier can serve
   both ways. I'd advocate having only the *first* parameter
   passable by reference, too (I feel that this limitation is
   a GREAT bug-squasher).

   Frogguy (a.k.a. the other Jacques)

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu