[Omake] [Ping Jason] Are we ready for 0.9.8?

Jason Hickey jyh at cs.caltech.edu
Sun Dec 10 14:24:05 PST 2006


That looks right to me.  The first two should be ValData.

For $0, I think ValData is the correct choice, because otherwise  
there is no way to recover the original input line.  For match it is  
no big deal, but for awk etc it might be nice to know what the  
original text was.

Jason

On Dec 9, 2006, at 7:49 PM, Aleksey Nogin wrote:

> On 08.12.2006 19:19, Jason Hickey wrote:
>
>> Last thing that bugs me (in the category for this release):
>>
>> Should regex matches produce ValData or ValString?
>>
>>     match $"a b c"
>>     case $'^\(.*\)$'
>>         x[] = $1
>>         printvln($x)
>>
>> produces
>>
>>     <array "a" "b" "c">
>>
>> This seems wrong to me.  I would say to change the regex matches to
>> ValData uniformly (I'm too lazy now, but they all use a single  
>> function
>> from Omake_env, so it is easy to change).
>
> Right, it's all going through the Omake_env.venv_add_match_args and
> Omake_env.venv_add_match. The full diff would be:
>
> Index: src/env/omake_env.ml
> ===================================================================
> --- src/env/omake_env.ml        (revision 9864)
> +++ src/env/omake_env.ml        (working copy)
> @@ -2399,20 +2399,20 @@
>     let venv, _ =
>        List.fold_left (fun (venv, i) arg ->
>              let v = Lm_symbol.add (string_of_int i) in
> -            let venv = venv_add_var_tmp venv v (ValString arg) in
> +            let venv = venv_add_var_tmp venv v (ValData arg) in
>                 venv, succ i) (venv, 1) args
>     in
>        venv
>
>  let venv_add_match venv line args =
> -   let args = List.map (fun s -> ValString s) args in
> +   let args = List.map (fun s -> ValData s) args in
>     let venv, _ =
>        List.fold_left (fun (venv, i) arg ->
>              let v = Lm_symbol.add (string_of_int i) in
>              let venv = venv_add_var_tmp venv v arg in
>                 venv, succ i) (venv, 1) args
>     in
> -   let venv = venv_add_var_tmp venv zero_sym (ValString line) in
> +   let venv = venv_add_var_tmp venv zero_sym (ValData line) in
>     let venv = venv_add_var_tmp venv star_sym (ValArray args) in
>     let venv = venv_add_var_tmp venv nf_sym   (ValInt (List.length  
> args)) in
>        venv
>
> The first two seem like an obvious choice, but I am not sure whether
> zero_sym should be ValData too.
>
>> It needs testing, but I would prefer it.
>
> I tried it and it does not seem to be causing any problems for the
> self-build. I can also try building MetaPRL. Other than that, I do not
> have any obvious things to test.
>
> Aleksey
>
> _______________________________________________
> OMake-Devel mailing list
> OMake-Devel at metaprl.org
> https://lists.metaprl.org/mailman/listinfo/omake-devel

--
Jason Hickey                  http://www.cs.caltech.edu/~jyh
Caltech Computer Science      Tel: 626-395-6568 FAX: 626-792-4257





More information about the OMake-Devel mailing list