rand(repeat(num_subjects, num_subjects))

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

Hopefully the subject above gets each of {1..num_subjects} exactly once blink

At 12:00 AM 6/27/98 -0400, Automatic digest processor wrote:
[<boot_me at GEOCITIES.COM> Re: Reply-To]
>    My understanding is that you are saying I would like to evaluate "a"
>expression by saying:
>    if a =  1 then
>        do this
>    elsif a= 1 and a = 2 then
>        do that
>            exit
>     elsif a = 1 and a = 2 and a = 3 then
>        do the other thingamajig
>            exit
>    else
>        don't do anything at all
>    end if
>If done sequentially according to the way you expect them to come out, it
>should short circuit itself just fine right???

    Hmm... if a = 1 then "do this" is done, else the other conditions can
    never possibly be right! (except the "don't do anything at all" part is
    done...)

[<jconsuegra at REDESTB.ES> Re: circuits]
>Why don't stop this useless quest?.

    Alright, I will. Sorry for having inconvenienced everyone.

[<C.R.White at SCM.BRAD.AC.UK> Re: atom() ambiguity]
>        not(not {x})
>
>...could be replaced with:
>
>        {x} != 0
>
>...which is a heck of a lot less typing and probably faster too :)

    Right... *if* you intend to truth-check a single-element sequence!

    That's very unlikely the case, probably you would leave out the braces
    around {x}? --> x != 0

[<C.R.White at SCM.BRAD.AC.UK> Re: Short Circuiting + Return in procedures]
>for index = start to finish by step do
>    if data[index] = what_you_want then -- note '=' rather than '!='
>        exit
>    end if
>end for

    That does nothing, because 'index' becomes undefined as soon as the
    program exits the for loop!

>PS Yes, I've used QBasic. IK that EXIT FUNCTION is used, but the syntax
>for returning a value is horrible.

    What about allowing both, Rob?

    It could be handy to allow qbasic's "exit ..." syntax, since it
    gives you a choice between which loop to exit. Example:

    SUB DoSomething ()
        FOR I = 1 TO 5
            J = 1
            DO WHILE J <= I
                PRINT J;
                J = J + 1
                IF J + I = 7 THEN
                    EXIT SUB        ' go to [A]
                    EXIT FOR        ' go to [B]
                    EXIT DO         ' go to [C]
                END IF
            LOOP
            '[C]
            PRINT
        NEXT
        '[B]
    END SUB
    '[A]

    Only the innermost loop of each type can be reached, but at least it
    gives us choice.

    By the way, how about allowing "continue;" as well? (While "break;"
    is translated to "exit", "continue;" has no Euphoria equivalent.)
    Perl's syntax has "next" and "last" and labels, but that would
    roughly be the equivalent of allowing goto.

[<ATU5713 at COMPUSERVE.COM> Re: About a technical list issue]
>Microsoft Outlook Express 4.72.2106.4
>Mozilla 3.04Gold (Win95; U)
>Microsoft Outlook Express 4.71.1712.3

    MS Outlook Express is MS's.
    Mozilla means Netscape.

[<davitf at USA.NET> Various subjects]
>[Get some chars]
>I hope it will be helpful for someone. If it isn't, just ignore it.

    Thanks. It would be for me. smile

>[Euphoria X Perl]

    Yes Perl supports sequences, but in a more obscure way.

[<daber at PAIR.COM> Re: Various subjects]
>I don't know Perl, but languages like Lisp and Scheme use "lists" that are
>just like our sequences. If my memory dosn't fails Rob said once that one of
>Euphoria "inspirations" was Lisp, or alike functional language.

    Right. I like Euphoria's way to manipulate sequences. They are VERY
    easy compared to LISP's, which I believe are composed of three
    functions that can only return
        length(x)
        x[1]
        x[2..length(x)]
    and you must use recursion to find e.g. x[3]. Right? (I haven't really
    used LISP = Lots of Irritating Silly Parentheses.)

[<rds at EMAIL.MSN.COM> Removal from Euphoria List]
>    SET EUPHORIA NODIGESTS

    Shouldn't that be:

    SET EUPHORIA MAIL

    ?

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

Search



Quick Links

User menu

Not signed in.

Misc Menu