Matthias Trute <mtr...@web.de> writes:

> Hi Enoch,
>
>>
>> As I promised to generalize crc8.frt (#1) a question was raised how would
>> the user configure it to its use, namely, select the generating
>> polynomial byte and the needed bit order (#2).
>> 
>> I answered the question through the following amforth-shell.py
>> improvement which introduces a local appl_owns.py substitutions file.
>> 
>> Without further ado here's the patch and its use for your perusal:
>> 
>> Patch: http://pastebin.com/uDK7fk9N
>
> A few notes
>
> +        sys.path.insert(0, ".")
>          if os.environ.has_key("AMFORTH_LIB"):
>            self._search_list = os.environ["AMFORTH_LIB"].split(":")
> -        else:
> -          self._search_list=["."]
>
> During my tests I found that change less useful. I run the shell
> not only from the appl directory but also from $HOME, so adding
> "." to the search path leads to a huge amount of files, the
> shell reads in upon start (on my system it took more than only
> a few seconds. And I have 8GB RAM, but my $HOME is bigger). So
> I reject this part of the patch. Sorry.

Point taken, I'll amend. My project resides outside the amforth
hierarchy, hence, I did not notice the hit.

> For the other stuff "appl_own.py" I've not opinion yet. What
> exactly is the problem you want to solve? What I would like to
> have is something that could the following (forth code!)
>
> [undefined] foo
>   #include foo
> [endif]

That all came in context of crc8.frt. It needs two configurable
constants as both the polynomial chosen and the reading order are
application specific (in fact MSB first is considered the reverse
order).

(
$D5 constant CRC8PLY 
-1 constant CRC8MSB
)

I said, how nice it would be if amforth-shell would do it for me just
like it does with Atmel's register/bit defs.

By the way, I surround the above constants with () which amforth-shell.py
respects but amforth itself does not. That's just perfect!

Regards, Enoch.


>
> for which the shell sends the content of foo unless foo is already
> defined. The control words are not sent to the controller as well.
>
> File oriented forth's have something like that, and I think the
> shell is capable of doing something similiar.
>
> Matthias
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to