gwl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Support for guile-config 0.5


From: Ricardo Wurmus
Subject: Re: Support for guile-config 0.5
Date: Wed, 01 Jun 2022 22:29:28 +0200
User-agent: mu4e 1.6.10; emacs 28.1

Hi again,

Taiju HIGASHI <higashi@taiju.info> writes:

> I'm not confident in them, but I will tell you my thought.
>
>>>          (switch
>>>           (name 'output)
>>>           (character #\o)
>>>           (synopsis "Set LOCATION as output for a workflow")
>>> -         (example "LOCATION"))
>>> +         (example "LOCATION")
>>> +         (default ""))
>>
>> This makes the “output” switch mandatory, but it’s optional.
>
> The (default (empty)) and the (default "") are different things.
> The (default (empty)) is the default value of the switch record default field.
> If I don't add that line, that switch will make evaluated as mandatory
> because the default field is (empty). [1]

Yes, you are right, sorry.

>>>          (switch
>>>           (name 'engine)
>>>           (character #\e)
>>> @@ -147,7 +148,6 @@ format) of the specified workflow.")
>>>         (list
>>>          (argument
>>>           (name 'file)
>>> -         (optional? #false)
>>>           (test file-exists?)
>>>           (handler identity)
>>>           (example "/path/to/my-workflow.w")))))
>>
>> And this just makes the file argument optional, but it’s not.
>
> It is not to change the meaning.
> The optional field of the argument record has been removed, so if I do
> not delete it, thus it will cause an error.

You are right.  Sorry, I got confused :)

> Since the default value of the default field of the argument record is
> (empty),  If I want to mandatory an argument record, In case I just
> delete the (optional? #f) line. [2]


So I guess the only thing I need to check is what to do when the default
value is the empty string.  We have some options that have validators.
When the value is the empty string and the validator merely checks that
the value is a string, then we would always pass validation in the
default case.

I’ll play with this some more and try to come up with better input
validation.

Thanks for getting the ball rolling with this patch!

-- 
Ricardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]