Deutsch   English   Français   Italiano  
<ec5339abbc9920049b4f4b79a62ca2702df730e6@i2pn2.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.misty.com!weretis.net!feeder9.news.weretis.net!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: fir <fir@grunge.pl>
Newsgroups: comp.lang.c
Subject: on changing paradigm of assign call
Date: Sun, 01 Sep 2024 16:15:37 +0200
Organization: i2pn2 (i2pn.org)
Message-ID: <ec5339abbc9920049b4f4b79a62ca2702df730e6@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 1 Sep 2024 14:15:44 -0000 (UTC)
Injection-Info: i2pn2.org;
	logging-data="484815"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="+ydHcGjgSeBt3Wz3WTfKefUptpAWaXduqfw5xdfsuS0";
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
X-Spam-Checker-Version: SpamAssassin 4.0.0
Bytes: 2574
Lines: 76

i tried to "design" well a function definition
and meed terrible stall i would say in thsi - dont know how to
do it  though i think few years on this

(the probl;ematic is especially this returned values part)

as its go so hard i began to think if this paradigm of calls is not just 
wrong and some somewhat new idea come to me (though partially i was
  thinking on it)

  in fact i fint annoying this form

  int x = foo()

  annoying is especially this "=" sign as this is not quite assignment imo

  other annoying think is thet you need to define x at all
  and maybe this is a problem or its part

  instead of

  int x = add(2,3)
  print(x)

  maybe it should be

  add(2,3)
  print(add)


  i mean the function name without the () should just represent the
  return value so you no need to asign it

  present c allows  print(add(2,3))
  but disalows to reuste it (and assign etc/et more

  im close to think it definitely should

  i mean

  strlen("sjsbsjbhs"")
  printf("%d", strlen)

  obviously some names could maybe not fit like

  find_character_position(txt, 'x');
>
  print(find_character_position);

  it should be moer lieke "found"

  but i think it could be resolved by allowing to define this


  int found  find_character_position(char* txt, char c);
  {
    //...
    // or return int found; //something liek that liek defining 
structure neme
  }

  then this found name should be avaliable to caller



  so

  find_character_position(txt, 'x');
  if(found>=0)....

or
  sumarize(2,3,3,2,2,3)
  if(sum<10) ...

  those function call asigments are probably some kind pf mistake
  (though it looks a bit weird not to do that)