How to Tell Phix Where the Standard Includes Are

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

In OE, I can use a settings file to direct Euphoria where to find the files I'm including in my source.

How do I do that with Phix, if my standard includes are in c:\Phix\std?

OK, on further review, apparently, there is no std/ include directory in a Phix installation. It's all in builtins?

I'm trying to add an intersection() function to the Phix source. One of these:

public function intersection(sequence a, sequence b) 
sequence s = {}, y, z 
 
    -- loop over the shortest sequence 
    -- although this probably takes longer than just looping over either one 
    -- I suspect with very large sequences, this might save more than 0 seconds 
     
    if length(a) > length(b) then 
        y = b 
        z = a 
    else 
        y = a 
        z = b 
    end if 
 
    for c=1 to length(y) do 
        if find(y[c],z) then 
            s = append(s, y[c]) 
        end if 
    end for 
return sort(s) 
end function 
public function intersection_more(sequence sources) 
sequence s = {} 
if length(sources) > 1 then 
    for b=1 to length(sources) do 
        if sequence(sources[b]) then 
            for c=1 to length(sources[b]) do 
                if find(sources[b][c],s) = 0 then 
                    s = append(s,sources[b][c]) 
                end if 
            end for 
        else 
            puts(1,"intersection(sources) - sources must be composed only of sequences") 
            ?9/0 
        end if 
    end for 
else 
    puts(1,"sequence parameter of intersection() requires a sequence of at least length 2") 
    ?9/0 
end if 
return sort(s) 
end function 

I wanted to try the "Pull request" functionality of the repo... grin

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

Search



Quick Links

User menu

Not signed in.

Misc Menu