1. How to Tell Phix Where the Standard Includes Are
- Posted by euphoric (admin) Feb 16, 2018
- 1100 views
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...
2. Re: How to Tell Phix Where the Standard Includes Are
- Posted by petelomax Feb 17, 2018
- 1058 views
You can just put a new file into builtins and it should find it.
Formal incorporation into the language involves making it an autoinclude (if appropriate, ie changes to psym.e) and properly documenting it (either in Library Routines or Other Libraries), along with checking the OE docs and sources for compatibility (aka minimising future incompatibilities) - on that front, my first question would be: is intersection_more() actually the same thing as union()?
So, posting here, exactly as you just have, is probably the best option right now.
3. Re: How to Tell Phix Where the Standard Includes Are
- Posted by euphoric (admin) Feb 17, 2018
- 1065 views
is intersection_more() actually the same thing as union()?
I'm not sure! Where is union() documented? I couldn't find it anywhere in the Phix docs.
On another note, you should probably do some SEO.