On 02/01/2014, at 2:48 PM, srean wrote:

> 
> My motivation was to mitigate the burden of updating the docs when the code 
> changes, which is quite often. 

Sure, mine too. But I never used this feature, don't trust it,
don't know how to control "include or don't include" the end marks,
etc etc.

So IMHO this particular design is a failed experiment.

> 
> Few questions:
> 
> in fdoc2html.flx

Oh and yes, a switch getting rid of those  numbers would be nice
(can't figure out simple way of doing it though).

> var
>  inp = fdocscanner.fdoc_scan t;
> 
> 0138:    gen
>  get_text () =>
> 
> 0139:      match #inp with
> 0140: 
>      | Some (Text ?x) => x
> 
> 0141:      | _ => ""
> 0142:      endmatch
> 0143: 
>    ;
> 
> 0144: 
>  next:>
> 
> 0145:    var entry = #inp;
>  
> Where does the body of the generator end.

Semicolon. After => is a single expression, which happens to be
a match .. endmatch.

> Where does the code get access to fdocscanner, what is it a module, typeclass 
> ?

It's an "object", see fdoc-scanner.flx.
So what happens is this loaded the plugin:

  fdocscanner-maker = Dynlink::load-plugin-func0 [fdocscanner-control_t] 
(dll-name="fdoc_scanner");

and this calls it to create the scanner:

  var fdocscanner = fdocscanner-maker ();


> Is inp a function ?

yes, 

        #f

means exactly the same as

        f ()

only the precedence of # is tighter.

> or a string. IIRC #inp stands for inp(). Is that right.

yes.

> I thought the '#" syntax is for simulating a constant (return value). Is that 
> what is happening here ?

Nope, this seems to be reading data each call.

> 
>  proc handle_cmd (b:string
> ) 
> 
> 0330: 
>    {
> 
> 0331:      if b == "felix" do inline_felix (#get_text);
>                                               ^^^^^  is that a call 
> get_text(), is it supposed to be a constant ? if not why use #get_text 
> instead of get_text() which would be clearer.


inline_felix (get_text())

is less to clear to me personally, because I find parens confusing.
[Just imagine the torture writing the parser actions in Scheme :]

If you wrote the above it would be fine. They're both correct.

> 
> 0332:      elif prefix (b,"felix ") do felix_file (strip (b.[6 to]));
> If a fdoc command has prefix "felix" then both inline_felix( ) and 
> felix_file( ) will get called ? right ? Or does prefix fire only if there is 
> a nonempty suffix ?

It's a standard if then else chain. Same as any other language, tests are
done in sequence. So it looks for exactly

@felix

first, then for

@felix filename

by checking prefix "felix " (note the space).

> 
> 0332:      ............................ b.[6 to]
> 
> Whoa! where is 'to' thing documented, I can guess what it does, but tutorial 
> on arrays seem to say nothing about it. Tell me more about it, or even 
> better, add it to the tut.

b is a string not an array.

The notations and semantics are isomorphic to Python:

        felix   Python
        b.[i]           b[i]
        b.[i to j]      b[i:j]
        b.[i to]        b[i:]
        b.[to j]        b[:j]

including the ability to use negative values to mean "from the end".
However illegal subscripts are allowed, no exception:

        "".[0]

for example returns char 0.




> and finally what does
> 
> @felix filename first last
> 
> do ? You did explain, but I could not follow.

It causes the webserver to display the file "filename" as Felix code
with highlighting etc, and if first and last are present it searches
the file for "first" and "last" and only displays the lines between these.
Or something like that. I don't use the range feature, as mentioned
earlier I think it is a bad design in detail.

> 
> BTW cut & paste syntax highlighted, line numbered, code snippets is working 
> great for request for clarification. This benefit of html docs had not 
> occurred to me


Not for me it isn't: it works fine in your posts but the formatting dies badly
in a reply. Technically HTML isn't allowed in email. Email has to
be plain text with lines less that 65 characters. Which means most
email clients allow you to post non-compliant email.
[HTML is allowed in attachments]


--
john skaller
skal...@users.sourceforge.net
http://felix-lang.org




------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to