From: Sergei Gavrikov <sergei.gavrikov@gmail.com>
To: Grant Edwards <grant.b.edwards@gmail.com>
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Re: Baffled yet again by CDL
Date: Thu, 22 Mar 2012 07:43:00 -0000 [thread overview]
Message-ID: <alpine.DEB.2.00.1203221035520.6985@sg-pc.belvok.com> (raw)
In-Reply-To: <jkdk33$og4$1@dough.gmane.org>
On Wed, 21 Mar 2012, Grant Edwards wrote:
> On 2012-03-21, Jay Foster <jay@systech.com> wrote:
> > Use
> >
> > default_value { "\"Foobar\"" }
> >
> > There are many examples in the eCos repository that do this.
>
> Thanks. I did find some examples after fixing my grep command.
>
> I still don't get why it's { "\"Foobar\"" } in a default value and {
> "Foobar" } when a user value. That doesn't seem intuitive at all.
Hi
Grant, I would explain it so, defalt_value vs user_value is something
like MI (machine interface) vs HI (human interface). Look at the value
of a 'defalt_value' as MI instance (i.e. an expression), but, the value
of a 'user_value' is a user input (an input in configtool, or editing
ecos.ecc config file). **No wrong with TCL here**. Well, then in C
#include <stdio.h>
main()
{
const char *default_value = "\"Foobar\""; // MI
char user_value[256];
printf("default_value is %s\n", default_value);
printf("user_value? ");
fflush(stdout);
fgets(user_value, sizeof(user_value) - 1, stdin); // HI
printf("user_value is %s\n", user_value);
return (0);
}
compare
% ./a.out
default_value is "Foobar"
user_value? Baz
user_value is Baz
and
% ./a.out
default_value is "Foobar"
user_value? "Baz"
user_value is "Baz"
CDL != TCL. CDL is a huge interface in C++ (~40K lines of code) which
uses TCL for some cases. There are useful comments in these sources
host/libcdl/cdlcore.cxx
host/libcdl/value.cxx
by the topic.
Sergei
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
next prev parent reply other threads:[~2012-03-22 7:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-21 20:31 [ECOS] " Grant Edwards
2012-03-21 21:20 ` Jay Foster
2012-03-21 22:18 ` [ECOS] " Grant Edwards
2012-03-22 7:43 ` Sergei Gavrikov [this message]
2012-03-22 16:55 ` Grant Edwards
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.00.1203221035520.6985@sg-pc.belvok.com \
--to=sergei.gavrikov@gmail.com \
--cc=ecos-discuss@sources.redhat.com \
--cc=grant.b.edwards@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).