<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.lang.felix.general">
    <title>gmane.comp.lang.felix.general</title>
    <link>http://blog.gmane.org/gmane.comp.lang.felix.general</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2937"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2936"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2935"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2933"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2930"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2927"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2926"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2925"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2904"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2903"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2902"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2900"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2897"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2896"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2895"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2894"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2893"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2892"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2891"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.felix.general/2888"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2937">
    <title>javascript compat</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2937</link>
    <description>&lt;pre&gt;Just running through w3schools javascript tut. In JS

"x" + 2 == "x2"

in Felix, the integer is converted to char 2, then to a one character string and
concatenated, so

"x" + 10

is the same as

"x\n"

Thinking of changing it. Comments?


BTW: A static object in Felix is a record of methods.
Well actually a record of anything. The method cannot access
each other or components of the record (only the private scope
of the constructor function). Unless you create the record manually
in a function that contains the record as a variable  :)

Now, a *dynamic* object would just be a dictionary.
Python for free anyone?

--
john skaller
skaller-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
http://felix-lang.org




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile securi&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-26T18:49:08</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2936">
    <title>iterators and comprehensions</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2936</link>
    <description>&lt;pre&gt;The iterator feature of Felix is one of the things I find I'm using  lot!

Let's review it: here's a list iterator:

  gen iterator[T] (var xs:list[T]) () : opt[T] = {
    while true do
      match xs with
      | Cons (?h,?t) =&amp;gt; xs = t; yield Some h;
      | Empty =&amp;gt; return None[T];
      endmatch;
    done
  }

Combined with some parser magic we get

for elt in list(1,2,3) do .. done

Of course this is similar to

iter (fun (elt:int) = { ... }) (list(1,2,3));

but prettier, more imperative, and easily escapable,
but both bodies are callbacks (driven by the iteration).

Iterators are easy to combine in a function (call one, do
a calculation, and yield something, to make a new iterator 
from an old one).

Now here's another construction:

  ctor list[T] (f: (1-&amp;gt;opt[T])) : list[T] = {
    var ff = f;
    fun aux (l:list[T]) = {
      var x = ff();
      return 
        match x with 
       | Some ?elt =&amp;gt; aux (Cons (elt,l)) 
       | None =&amp;gt; rev l
       endmatch
      ;
    }
    return aux Empty[T];
  }

Thi&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-26T12:40:12</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2935">
    <title>Dictionary type implemented</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2935</link>
    <description>&lt;pre&gt;I have implemented a basic dictionary type.

Here's how to use it. First for convenience we need these:


fun dflt : opt[string] -&amp;gt; string =
| Some ?x =&amp;gt; x
| None =&amp;gt; "NONE"
;

fun dflt : opt[string * string ] -&amp;gt; string * string =
| Some ?x =&amp;gt; x
| None =&amp;gt; "NONE","NONE"
;


Now we can do:

/////////
var x = strdict[string] ();
add x "Hello" "World";
println$ dflt$ get x "Hello"; 
println$ "Missing .." + dflt (get x "silly");
////////

you can also write:

x.add "Hello" "World" 

using the operator . style. We get:

~/felix&amp;gt;flx jj
World
Missing ..NONE

The "dflt" function is  a way to map:

dflt: opt[T] -&amp;gt; T

so you don't have to keep matching against Some/None.

You can delete entries:

/////////
var found = del x "Hello";
println$ "Found="+ str found;
found = del x "Hello";
println$ "Found="+ str found;
//////

which gives:

Found=true
Found=false

Remember, "del" is a generator, you cannot ignore the returned value!
Or Felix will silently remove the result variable, and thence the deletion!

You can make a &lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-26T03:44:14</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2933">
    <title>plugin data</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2933</link>
    <description>&lt;pre&gt;At present the plugins don't hyperlink correctly because the data
format is wrong. They're being fed the server_config.cfg file
which has stuff like:

# Configuration file for webapp
delay=0.05
port=8080
server_root=.
document_root=$server_root/html
C_PATH = $INSTALL_ROOT/lib/rtl,/usr/local/include,/usr/include,/usr/include/c++/4.6.2,/usr/local/include,/usr/include,/usr/include/c++/4.2.1,/usr/include/c++/4.2.1/x86_64-apple-darwin10,/usr/include/c++/4.4.3,/usr/include/c++/4.4.3/x86_64-linux-gnu,/usr/lib/gcc/x86_64-linux-gnu/4.4.3/include
FLX_PATH=$INSTALL_ROOT/lib
FDOC_PATH=$DOCS,$DOCS/doc,$DOCS/web
FLX_PKGCONFIG=$INSTALL_ROOT/config
DB = $server_root/db/wiki.db

in it. The plugins require

C_PATH += /usr/include/c++/4.2.1
C_PATH += /usr/include/c++/4.2.1/x86_64-apple-darwin10
C_PATH += /usr/include/c++/4.4.3
C_PATH += /usr/include/c++/4.4.3/x86_64-linux-gnu
C_PATH += /usr/lib/gcc/x86_64-linux-gnu/4.4.3/include

instead. Although the wiki config does try to build a native Felix
representation of this data, it&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-25T00:47:42</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2930">
    <title>Extending flx_pkgconfig</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2930</link>
    <description>&lt;pre&gt;I'm extending the capabilities of flx_pkgconfig, so it can query pkgconfig (*.pc)
databases.

pkgconfig is a seriously bad program. It is very badly written,
it is full of bugs, and it has limited capabilities (which is why
flx_pkgconfig was written). Indeed, it has a very specialised application
and it can't even handle that properly.

I have extended flx_pkgconfig (next commit) to add;

--help

well it should always have had that ..

--extension=fpc

to set the extension to look for, if you set pc it will find pkgconfig files
instead of flx_pkgconfig files (will play with this to see if both can
be queried at once later).

I have added variables as used by pkgconfig:

prefix = /usr/local
lib = ${prefix}/lib

Libs: -L${lib} -lmylib

Also blank lines are tolerated, and lines starting with # are skipped.
pkgconfig allows trailing # comments which are not handled yet.

Pkgconfig also doesn't allow comma separators: some options go
like this:

-W1,linkeropt,-W1

and have embedded commas, so I'll have to r&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-24T10:53:08</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2927">
    <title>ncurses on OS, a note</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2927</link>
    <description>&lt;pre&gt;I'm writing some ncurses stuff to perhaps help manage Felix
installations etc. 

I found the installed version on OSX doesn't work. I found this note:

http://www.uponmyshoulder.com/blog/2010/fix-ncurses-in-os-x-10-6-3/

and I'm trying it out. Nope. Press an arrow key and still get the f'ing escape
sequence, not interpreted by ncurses as it should be.

Unix is such .... Terminals. Ye gads, how utterly archaic is this concept?
We've had actual keyboards and screens on PCs for a while.

Ah well. No idea how to proceed, except perhaps make a Felix
resource data base to replace the crap. I note, the terminal emulators
all work fine.



--
john skaller
skaller-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
http://felix-lang.org




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint securit&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-24T04:29:30</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2926">
    <title>windows utils</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2926</link>
    <description>&lt;pre&gt;gnuwin32.sourceforge.net/

--
john skaller
skaller-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
http://felix-lang.org




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-23T12:42:23</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2925">
    <title>automagical record coercions (record subtyping)</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2925</link>
    <description>&lt;pre&gt;At present if you have a function accepting a record with
the set of fields F, you can call it with a record with
the set of fields G, provided F is subset of G, and,
you *explicitly* coerce G to F:

typedef F = (a:int);
typedef G = (a:int, b:int);
fun f(x:F)=&amp;gt;x.a;
var g = (a=1, b=2);
println$ f( g :&amp;gt;&amp;gt; F);

If you leave off the coercion, you will get this:

Client Error binding expression (f g)
CLIENT ERROR
[lookup_name_with_sig] Can't find f of struct  {a:(int);b:(int);}
In /Users/johnskaller/felix/./ft.flx: line 5, cols 9 to 10
4: var g = (a=1, b=2);
5: println$ f( g);
           **
6:


There's an argument to provide "some kind of subtyping" here:
a G "is an F" (it just has extra fields). The coercion we use has
a common generic name in algebra: "the forgetful functor",
which is a structure preserving map that simply "forgets" some
of its domains structure.


If we could do automagical coercions, you could write "generic"
functions and just call them with any record which extended
the parameter type, with&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-22T00:07:35</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2904">
    <title>Objects in Felix</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2904</link>
    <description>&lt;pre&gt;Felix has been able to do OO for some time, it just isn't sugared.
Here's an example:

//////////////////
// An OO experiment

fun X (var x:int, var y:int) = {
  proc setx(a:int) { x = a; } 
  proc sety(a:int) { x = a; } 
  fun getx() =&amp;gt; x;
  fun gety () =&amp;gt; y;
  fun sum () =&amp;gt; x + y;
  return (setx=setx, sety=sety, getx=getx, sum=sum);
}

var a = X(2,3);
println$ a.getx();
a.setx(22);
println$ a.getx(), a.sum();

var b = a :&amp;gt;&amp;gt; (sum:1-&amp;gt;int);

proc f(v:(sum:1-&amp;gt;int)) 
{
  match v with
  | (sum= ?pp)=&amp;gt; println$ pp();
  endmatch;
}

f b;
/////////////


Here, X can be viewed as a constructor for an object.
The type of the object is:

(
  setx:int-&amp;gt;void,
  sety:int-&amp;gt;void,
  getx: unit -&amp;gt; int,
  gety: unit -&amp;gt; int,
  sum: unit -&amp;gt; int
)

that is, it's a record of functions. Notice that the "data" is 100% encapsulated
by the constructor function in this case (but, you could return a pointer
if you wanted a variable, or a value if you didn't).

Now the line

var b = a:&amp;gt;&amp;gt; (sum: 1-&amp;gt; int);

is an upcast (coercion) to a typ&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-17T17:38:21</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2903">
    <title>install layout</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2903</link>
    <description>&lt;pre&gt;Im still struggling with the install layout.

This makes sense:

felix/share/felix-version/lib/std/*.flx ... etc etc

Each version has a new standard library, tool sources, etc.
This would also cover C++ sources.

Now, the platform dependent stuff is in two parts:

(a) configuration data: *.fpc files, specs for calling C++,
C++ config headers.

(b) compiled binaries: executables, static libs, shared libs

There will be a standard one of these: host, an abstract name
for the current desktop config. Sharable between users.

Other configs could be installed for cross compiling.

Each user currently has $HOME/felix with personal data.
Presently this is just cache data PLUS if the user is a felix
developer, initialisation data for the host config.

In principle, the config data depends on the platform
not on the Felix version. It may change with compiler
upgrades (independently of the Felix version).

So one problem here is whether to version the config data.
It will surely change with Felix version. On the other&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-17T12:48:18</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2902">
    <title>xml2</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2902</link>
    <description>&lt;pre&gt;How much does the webserver (mikes) and wiki
depend on xml2? 

It's another dependency ..

--
john skaller
skaller-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
http://felix-lang.org




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-16T01:23:13</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2900">
    <title>reading unit</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2900</link>
    <description>&lt;pre&gt;The following never works and can't be made to work:

var ch = ischannel[unit] ();
var u = read ch;

The reason is: you cannot use the unit value u, so the read is
optimised away. Even

C_hack::ignore(u);

fails with a diagnostic, because Felix tries to optimise away all units,
and there's a diagnostic in the code generator to report when the
front end failed to do this. The only way to do it is to use
a supervisor call, and it isn't clear even that will work.

--
john skaller
skaller-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
http://felix-lang.org




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-14T22:10:18</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2897">
    <title>catch variable name</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2897</link>
    <description>&lt;pre&gt;So here's the new code:

////
proc mythrow[T] : T  = "throw $1;";
const fred: int = "fred";

try 
  var x = 1;
  mythrow 20;
  x = 10;
catch fred : int =&amp;gt;
  x = 2;
  println$ "Exception " + str fred;
endtry

println$ x;
////

The reason you still have to type the variable name is ...
I don't know how else to do it at the moment.

An obvious implementation is to convert the catch code into a procedure:

proc x73735 (fred:int) { 
  x = 2;
  print$ ..
}

and then:

catch (int &amp;amp;exn) { x73735 exn; }

The problem with this .. and in many other similar cases is that

return

won't work.  Felix has no frontend block concept.
This issue also impacts yield. It also changes the kind
of gotos, but Felix can handle non-local gotos.

Which suggests .. non-local returns.

Actually a block would be nice, which allowed local variables
without interfering with returns and perhaps supervisor calls,
as well as goto's into the block: the variables would be lifted out,
eliminating the block, and renamed to prevent a conflict.

F&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-10T11:10:03</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2896">
    <title>Install tree</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2896</link>
    <description>&lt;pre&gt;I am thinking of changing the install tree to this

/usr/local/lib/felix/host/felix-latest/....

[replace / with \ on windows]

or perhaps 

felix-latest/host/...

not sure whether to put the target or the version first.
Might have to change the cache address in a similar way.

The idea is that you can say:

flx --target=platform ....

where the default platform is host. The host platform is configured
to edit, compile, and run on your desktop machine (as detected by
the build system).

The platform name would be arbitrary, although it may pay to copy
the idea gcc uses assuming gcc is halfway reasonable about 
cross compilation. I think that's:

i686-apple-darwin10-gcc-4.2.1

on my box:

processor-vendor-os-product-version


On my box at least I want to test:

* both 32 and 64 bit targets
* both gcc and clang

which is 4 distinct platforms .. all of which are technically still "host"
platforms. 

Actually, since most of the code is platform independent it would probably be more like:

/usr/local/lib/feli&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-10T10:35:05</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2895">
    <title>semantics</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2895</link>
    <description>&lt;pre&gt;I'm still struggling to lock down Felix semantics.

As stuff like try/catch shows, certain code has to be stackless,
and other code doesn't.

It's hard to know what's what due to the optimiser.
Current "inline" makes a difference: non-flat code can be
flattened by inlining. You can only do supervisor calls from
flat code (zero stack). If you make C blocks like
try { .. } .catch { .. }  (and sometimes while () { .. } or for () { .. } etc)
you're introducing a stack which prevents returning to the 
supervisor, as well as jumping into the block (you can jump
into a while or for provided there are no variable initialisations
missed)

I need to carefully sort out what's what, and provide annotations
for enforcement. Eg

stack proc f (..) ...

ensures the proc f is on the stack or inlined not the heap, 

heap proc f () .. 

ensures inlining or on the heap or something :)

--
john skaller
skaller-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
http://felix-lang.org




------------------------------------------&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-10T04:08:10</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2894">
    <title>Exception experiment</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2894</link>
    <description>&lt;pre&gt;The following code now works:

///////////////
proc mythrow[T] : T  = "throw $1;";
const exn : int = "_exn";

try 
  var x = 1;
  mythrow 20;
  x = 10;
catch int :&amp;gt;
  x = 2;
  println$ "Exception " + str exn;
endtry

println$ x;
/////////////////////
~/felix&amp;gt;flx --test=build/release ex
Exception 20
2
/////////////////

Note: this is experimental DO NOT USE in production code.
For playing only. It generates the "obvious" C++:

try { ....}
catch (int &amp;amp;_exn) { .. }

Note temporary hack: the exception caught is named _exn.
This is mainly because I couldn't figure out how to allow the user
to name it: it can be done, and the syntax will probably change to

catch (x:int) =&amp;gt; ....

The catch thing is basically a procedure, but it isn't declared in the
normal way, so I have to actually think about how the
variable gets a name. The implementation is a hack: try just
generates "try {" and endtry just generates "}" and catch generates
"} catch (" + type + " &amp;amp;_exn) {": naming the variable should imply
it has a scope from&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-09T14:20:52</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2893">
    <title>sugar</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2893</link>
    <description>&lt;pre&gt;Just some quickies: Mike has this:

  fun get_suffix(fn:string) = {
    var fname = fn;
    var suffix = "";
    match rfind (fname, "?") with
      | Some ?pos =&amp;gt; { suffix = fname.[pos + 1 to]; fname=fname.[0 to pos]; }
      | None[int] =&amp;gt;
      {
        match rfind (fname, ".") with
          | None[int] =&amp;gt; {}
          | Some ?pos =&amp;gt; { suffix = fname.[pos + 1 to]; }
        endmatch; 
      }
    endmatch;
    return suffix;
  }

which is perfectly valid: calculate a closure then execute it. But Felix
now has statement matches so you can write this too:

  fun get_suffix(fn:string) = {
    var fname = fn;
    var suffix = "";
    match rfind (fname, "?") with
      | Some ?pos =&amp;gt; suffix = fname.[pos + 1 to]; fname=fname.[0 to pos]; 
      | None[int] =&amp;gt;
      
        match rfind (fname, ".") with
          | None[int] =&amp;gt; {};
          | Some ?pos =&amp;gt;  suffix = fname.[pos + 1 to]; 
        endmatch; 
      
    endmatch;
    return suffix;
  }

But then, we could get more functional again:

  fun get_suf&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-09T08:19:53</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2892">
    <title>backing up the wiki</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2892</link>
    <description>&lt;pre&gt;I'm a unix ignoramus, need help figuring out how to store the wiki data.

1. The plan to start is to manually push/pull from a github repository.

2. The name of the directory containing the wiki must match the repository name
AFAIK.

3. because we're using git hub, the tutorial etc can be part the wiki,
and still edited offline. Very nice. Though we don't know how to handle
conflicts.

4. For security reasons, the wiki is run under account felixweb, which
does not have a login shell (I think the home directory is mine though :)

5. Currently the data is own felixweb group felixweb.
The wiki account cannot push/pull because it has no shell
and no keys.

6. I can't push/pull either because my account is an ordinary one,
I can't modify another users files.

7. root can't use ssh for security reasons.

8. I am guessing .. note *guessing* a possible solution is to make
myself and mike and felixweb members of group felixweb
then we can use our personal accounts to push/pull the data,
though I don't know who the o&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-09T06:53:34</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2891">
    <title>try/catch</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2891</link>
    <description>&lt;pre&gt;I'm playing with this:

var n = 1;
var d = 0;

union numeric_error = | overflow of string | divide_by_zero of int;
type std_exception = "::std::exception";
fun msg: std_exception -&amp;gt; string = "$1.msg";

var r = 
  try n/d
  catch numeric_error with
  | overflow ?s =&amp;gt; -1
  | divide_by_zero ?n =&amp;gt; n
  catch std_exception with
  | ?x =&amp;gt; #{ println$ "exception " + x.msg; throw x; return 0; }
  endtry
;

The idea is basically to be able to catch a (C++) exception
thrown by an expression and return an alternate value.

Perhaps a better example:

try fold_left (fun (acc, elt) =&amp;gt; if elt == 0 then throw 0 else acc * elt) lst
catch int with | ?i =&amp;gt; i 
entry

Basically, you can have a series of catch clauses,
which catch particular types, and then pattern match
the caught value and return some expression. This allows
default values and shortcuts. The pattern match is an
ordinary match on the caught exception. The match handlers
must all return a value of the primary expression type
(the type any should be allowed as well&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-05-06T13:32:51</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2888">
    <title>linkage names</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2888</link>
    <description>&lt;pre&gt;I have been playing with the new naming system.

It works kinda like this:

//PRIMITIVE 8473 INSTANCE 83822: string
typedef ::std::basic_string&amp;lt;char&amp;gt; _a8473t_83822;
typedef int _us2;

//PRIMITIVE 3795 INSTANCE 83825: int
//typedef int int;

//TYPE 83827: string^2
typedef _at&amp;lt;_a8473t_83822,2&amp;gt; _at83827;

//TYPE 83828: string * list[string]
typedef _tt2&amp;lt;_a8473t_83822,void*&amp;gt; _tt83828;

//TYPE 83829: list[string]^2
typedef _at&amp;lt;void*,2&amp;gt; _at83829;

//PRIMITIVE 5809 INSTANCE 83830: ostream
typedef ::std::ostream* _a5809t_83830;

//TYPE 83831: ostream * string
typedef _tt2&amp;lt;_a5809t_83830,_a8473t_83822&amp;gt; _tt83831;

...

//TYPE 83827: string^2
template &amp;lt;&amp;gt; struct _at&amp;lt;_a8473t_83822,2&amp;gt; {
  static size_t const len = 2;
  typedef _a8473t_83822 element_type;
  _a8473t_83822 data[2];
  _at&amp;lt;_a8473t_83822,2&amp;gt;() {}
  _at&amp;lt;_a8473t_83822,2&amp;gt;(_a8473t_83822 a0, _a8473t_83822 a1) {
    data[0] = a0;
    data[1] = a1;
  }
};

//TYPE 83828: string * list[string]
template &amp;lt;&amp;gt; struct _tt2&amp;lt;_a8473t_83822,void*&amp;gt; {
  _a8473t_83822 mem_0;
  void* m&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-04-30T19:19:18</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.felix.general/2887">
    <title>grrr</title>
    <link>http://comments.gmane.org/gmane.comp.lang.felix.general/2887</link>
    <description>&lt;pre&gt;Why do I hate unix so much ... grrr ...

This works fine on my OSX box,
but on Linux:

skaller&amp;lt; at &amp;gt;felix:~/felix$ build/release/bin/flx_ls . '.*flx.*'
src/demux/flx_demux.hpp
src/rtl/flx_main.cpp
src/rtl/flx_compiler_support_bodies.hpp
src/rtl/flx_ioutil.cpp
src/rtl/flx_eh.hpp

[There are hundreds of files that match the pattern]

Actually I' just trying to find where Mike put the Wiki so I can
make a Git repo for the contents. Locate doesn't find it.

The pain is: flx_ls is designed for this job, to replace the 
unix file system and tools handling of directories (which is
exceptionally bad).

--
john skaller
skaller-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f&amp;lt; at &amp;gt;public.gmane.org
http://felix-lang.org




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malwar&lt;/pre&gt;</description>
    <dc:creator>john skaller</dc:creator>
    <dc:date>2012-04-30T05:34:34</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lang.felix.general">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.lang.felix.general</link>
  </textinput>
</rdf:RDF>

