Re: New and having problems

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

In "Ruby thinking" there is a tendency to invent a new convenient rule for every situation. If your mind works like that of Matsumoto, then these "rules" effectively do not exist and you become a fan of Ruby. If you study how Ruby is put together you will find lots of inconsistencies, but if you think in Ruby then these inconsistencies are why you use Ruby.

In "Euphoria thinking" there are just a few rules that work the same all the time. The "charm" of Euphoria is that you don't have to put lots of ideas into your head, and when everything works the same, all the time, you reduce "congnitive load" and your brain feels better.

object stuff 
-- "%s" means output **one** //item//; THAT IS THE RULE 
        -- the 's' means in 'string format' 
        -- sorry, the "s" was borrowed from "C" syntax 
 
printf(1, "%s", "hello" ) 
    --> h 
    -- "hello" is a sequence with **five** items 
    -- one item; THE RULE IS FOLLOWED 
 
printf(1, "%s", { "hello" } ) 
    --> hello 
    -- { "hello" } is a sequence with **one** item 
    -- one item; THE RULE IS FOLLOWED 
 

I something is "going wrong" in Euphoria, it is because you forgot the RULE IS THE SAME ALL THE TIME.


As SDPringle just mentioned take a look at:

include std/cmdline.e

cmd_parse()


You can concatenate command line arguments together, or you an join them:

-- must execute this demo this some command line arguments... 
-- for example $ eui demo -i foo moo 
 
 
include std/sequence.e 
include std/console.e 
 
sequence cmd = command_line() 
 
display( cmd ) 
 
/* 

{ 
  "eui", 
  "demo", 
  "-i", 
  "foo", 
  "moo" 
} 
*/ 
 
 
sequence arg = join( cmd[4..$], " " ) 
 
display( arg ) 
 
--> foo moo 
 
 

_tom

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

Search



Quick Links

User menu

Not signed in.

Misc Menu