X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-08_02:2015-02-08,2015-02-08,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=3 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502080134 From: Chris Smith Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (1.0) Subject: Re: [geda-user] Using Lua to safely read configuration and layout files (program attached) Message-id: Date: Sun, 08 Feb 2015 12:41:12 +0000 References: <2047684 DOT lX4NXpYgtQ AT jasum> <201502072235 DOT t17MZuaZ025960 AT envy DOT delorie DOT com> <32380475 DOT xlWdxyhFd9 AT jasum> <20150208003842 DOT 63db8a55 AT jive> In-reply-to: <20150208003842.63db8a55@jive> To: "geda-user AT delorie DOT com" X-Mailer: iPad Mail (12B466) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id t18CfKHe016453 Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > On 7 Feb 2015, at 23:38, Lev wrote: > > On Sun, 08 Feb 2015 00:00:23 +0100 > Christian Riggenbach wrote: > >> To state the obvious: yeah, that would be a problem. Either code the >> unit- system in the core (hard to maintain), use something as trivial >> as "3*mm + $n >> * 10*mil" and define mm end the other units as factors (hard to >> read). And unit-parsing on an higher level would negate the added >> benefit of a parser in the first way. > > I wouldn't use ANY scripts in the PCB or sch file. That would make life > very hard. I'd use to parse the data in a > file. This is the task to be done, just don't overcomplicate the solution. I > would be happy if it was Lua, but we could roll our own language and parser. > > If there is something we can do, it doesn't mean we must do it. I agree that scripts/expressions would have little use and cause problems in general schematics which are modified and saved often, but I can also see that it would be very useful for parametric symbols and reusable sub-circuits. I wouldn't want to limit the parser/interpreter to preclude it - it would be better to define what will and won't be supported by the application. It might be enough simply to say that schematics/symbols can be as dynamic as you like, but they will be evaluated once when instantiated and will be static from that point on. Chris