Re: [WebDNA] function variables

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 106823
interpreted = N
texte = What about Ruby's ability to have many arguments: def some_method(*arguments) On Fri, Jun 24, 2011 at 12:06 PM, Brian B. Burton wrote= : > 1) could not agree more about the comma separated parameters.. wait.. > [table name=3Dproducts&fields=3DSKU,NAME,DESC] > ummm... > > 2) > a) Way too much typing, i don't like typing that much. > b) I can paint my cat brown and teach it to bark, or I can go buy a dog. = I'd rather buy a dog and do something else with my free time. > c) not naming variables in function tags makes webdna nonstandard. > > PYTHON: > def multiprint( n=3D5, txt=3D"" ): =A0 =A0// also allows one to set defau= lt values for variables if not overridden when called. > > RUBY: > def some_method(a, b, c=3D25) =A0// more of the same > > PHP: > function writeName($fname,$punctuation) > > C++: > output function_name (input_1, input_2, input_3, input_...) { > > > > > Brian B. Burton > > > > On Jun 23, 2011, at 8:05 PM, Brian Fries wrote: > >> The comma-separated parameters looks very alien in WebDNA code, where & = and =3D are king. This also would force an order dependency for the paramet= ers, which is also alien to WebDNA. That said, there's nothing stopping you= from implementing your function now: >> >> [function name=3Dmadlibs][!] takes name,color,place,fruit,size [/!] >> =A0 =A0 =A0 [!] default values [/!] >> =A0 =A0 =A0 [text multi=3DT]tName=3DBilly Bob&tColor=3Dpink&tPlace=3DHaw= aii&tFruit=3Dpineapple&tSize=3Dbig[/text] >> >> =A0 =A0 =A0 [listwords words=3D[url][params_string][/url]&delimiters=3D,= ] >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 [switch value=3D[index]] >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 [case value=3D1][text]tName=3D[word][/text][= /case] >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 [case value=3D2][text]tColor=3D[word][/text]= [/case] >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 [case value=3D3][text]tPlace=3D[word][/text]= [/case] >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 [case value=3D4][text]tFruit=3D[word][/text]= [/case] >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 [case value=3D5][text]tSize=3D[word][/text][= /case] >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 [/switch] >> =A0 =A0 =A0 [/listwords] >> >> =A0 =A0 =A0 [return][tName] likes [tColor] cars at [tPlace], where [tFru= it] is [tSize].[/return] >> [/function] >> >> [madlibs Jane,orange,the mall,strawberry,monstrous] >> >> >> Result: >> Jane likes orange cars at the mall, where strawberry is monstrous. >> >> >> Brian Fries >> BrainScan Software >> >> >> >> On Jun 23, 2011, at 3:21 PM, Brian B. Burton wrote: >> >>> add to the wish list: >>> >>> being able to set the names of incoming variables when defining the fun= ction. > > > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > Bug Reporting: support@webdna.us > Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] function variables (William DeVaul 2011)
  2. Re: [WebDNA] function variables ("Brian B. Burton" 2011)
  3. Re: [WebDNA] function variables (Brian Fries 2011)
  4. [WebDNA] function variables ("Brian B. Burton" 2011)
What about Ruby's ability to have many arguments: def some_method(*arguments) On Fri, Jun 24, 2011 at 12:06 PM, Brian B. Burton wrote= : > 1) could not agree more about the comma separated parameters.. wait.. > [table name=3Dproducts&fields=3DSKU,NAME,DESC] > ummm... > > 2) > a) Way too much typing, i don't like typing that much. > b) I can paint my cat brown and teach it to bark, or I can go buy a dog. = I'd rather buy a dog and do something else with my free time. > c) not naming variables in function tags makes webdna nonstandard. > > PYTHON: > def multiprint( n=3D5, txt=3D"" ): =A0 =A0// also allows one to set defau= lt values for variables if not overridden when called. > > RUBY: > def some_method(a, b, c=3D25) =A0// more of the same > > PHP: > function writeName($fname,$punctuation) > > C++: > output function_name (input_1, input_2, input_3, input_...) { > > > > > Brian B. Burton > > > > On Jun 23, 2011, at 8:05 PM, Brian Fries wrote: > >> The comma-separated parameters looks very alien in WebDNA code, where & = and =3D are king. This also would force an order dependency for the paramet= ers, which is also alien to WebDNA. That said, there's nothing stopping you= from implementing your function now: >> >> [function name=3Dmadlibs][!] takes name,color,place,fruit,size [/!] >> =A0 =A0 =A0 [!] default values [/!] >> =A0 =A0 =A0 [text multi=3DT]tName=3DBilly Bob&tColor=3Dpink&tPlace=3DHaw= aii&tFruit=3Dpineapple&tSize=3Dbig[/text] >> >> =A0 =A0 =A0 [listwords words=3D[url][params_string][/url]&delimiters=3D,= ] >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 [switch value=3D[index]] >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 [case value=3D1][text]tName=3D[word][/text][= /case] >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 [case value=3D2][text]tColor=3D[word][/text]= [/case] >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 [case value=3D3][text]tPlace=3D[word][/text]= [/case] >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 [case value=3D4][text]tFruit=3D[word][/text]= [/case] >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 [case value=3D5][text]tSize=3D[word][/text][= /case] >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 [/switch] >> =A0 =A0 =A0 [/listwords] >> >> =A0 =A0 =A0 [return][tName] likes [tColor] cars at [tPlace], where [tFru= it] is [tSize].[/return] >> [/function] >> >> [madlibs Jane,orange,the mall,strawberry,monstrous] >> >> >> Result: >> Jane likes orange cars at the mall, where strawberry is monstrous. >> >> >> Brian Fries >> BrainScan Software >> >> >> >> On Jun 23, 2011, at 3:21 PM, Brian B. Burton wrote: >> >>> add to the wish list: >>> >>> being able to set the names of incoming variables when defining the fun= ction. > > > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > Bug Reporting: support@webdna.us > William DeVaul

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

WebCat2b13MacPlugIn - [include] (1997) Maximum characters in header? (1999) Programmer Needed (1998) [WebDNA] macOS 10.13.3 and WebDNA Mac Server 8.5.1 - hick-up (2019) Configuring E-mail (1997) [WebDNA] A new popuated field to a DB with 700.000 records (2009) Sort Floating Point Number (2008) Encrypted links ... (2000) Using [Include] Context (1999) [OT] Mom's gift (2006) Fun with Dates - finally resolved but.... (1997) Shopping carts and reloading pages (1997) color and size options (1997) Cold Fusion Buster (1997) Duplicate Carts (2000) RequiredFields template (1997) problems with 2 tags shakur (1997) Multiple Newcarts (1996) [OT] Brain Switching (2004) Its slow.... (2004)