Quick survey: func(..) {..} versus (..) {..}

Jay Woods woodsjaya at gmail.com
Sat Jul 26 11:58:42 UTC 2014


Something went wrong - this is probably the second post.

Here is a nonworking example based on a C function:

    fun short get_cp_amtMaxfee(double d){ i=d; return i; };

All that I had in mind was the observation to put the typing of the return
near
the return. We all, of course, have the return as the last statement in the
function. :-) The compiler could, of course, type the return from the type
of the variable or even the reverse, type the variable 'i' from the type of
the return. It would look like:

    fun get_cp_amtMaxfee(double d){ i=d; return i; } short;

This also gets around the compiler wondering if it is short that is a
function. I also like the idea of presenting the verbage of qualifiers in
order of strength.

As for what people are familiar with, let's not get too wrapped up in that.
Most programming is done with the language biases of the Indo-Europeans.
Most language usage is Chinese. Their language biases are considerably
different. We will be seeing the time and soon that those biases will drive
acceptance.


On Fri, Jul 25, 2014 at 6:51 PM, Samuel Gaist <samuel.gaist at edeltech.ch>
wrote:

> I'm not sure I'm following you right. Could you show some examples  ?
>
> On 25 juil. 2014, at 23:37, Jay Woods <woodsjaya at gmail.com> wrote:
>
> > But then I'd like to see any typing of the return after the function.
> funcName() {} string
> >
> >
> > On Fri, Jul 25, 2014 at 5:19 PM, Samuel Gaist <samuel.gaist at edeltech.ch>
> wrote:
> > +1,
> >
> > I'd rather have to read and write more if that makes the code easier to
> understand.
> >
> > On 25 juil. 2014, at 16:10, Jay Woods <woodsjaya at gmail.com> wrote:
> >
> > > Definitely with func.
> > >
> > > In the future, it can always be made optional (for use by the novice
> and pretty print).
> > >
> > >
> > > On Fri, Jul 25, 2014 at 9:58 AM, Aaron J. Seigo <aseigo at kde.org>
> wrote:
> > > Quick question time!
> > >
> > > How do you feel this:
> > >
> > > =======
> > > myFunction()
> > > {
> > >         let Bar = func() { true; }
> > >         Bar();
> > > }
> > >
> > > receiver func(PID, $auth, message) { ... }
> > > =======
> > >
> > > compares to this:
> > >
> > > =======
> > > myFunction()
> > > {
> > >         let Bar = () { true; }
> > >         Bar();
> > > }
> > >
> > > receiver (PID, $auth, message) { ... }
> > > =======
> > >
> > >
> > > for readability and clarity?
> > >
> > >
> > > Pros of func():
> > >         * makes it clear that this is a function declaration
> > >
> > > Pros of ():
> > >         * no reserved words
> > >         * less typing and reading
> > >
> > > --
> > > Aaron J. Seigo
> > > _______________________________________________
> > > Funq-devel mailing list
> > > Funq-devel at kde.org
> > > https://kde.org/mailman/listinfo/funq-devel
> > >
> > >
> > > _______________________________________________
> > > Funq-devel mailing list
> > > Funq-devel at kde.org
> > > https://kde.org/mailman/listinfo/funq-devel
> >
> > _______________________________________________
> > Funq-devel mailing list
> > Funq-devel at kde.org
> > https://kde.org/mailman/listinfo/funq-devel
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kde.org/pipermail/funq-devel/attachments/20140726/3589f10e/attachment.html>


More information about the Funq-devel mailing list