Keyword abuse (Re: reduced size symbols/keywords)



On Aug 29, 4:15 pm, Tim Bradshaw <tfb+goo...@xxxxxxxx> wrote:
On Aug 29, 6:39 am, verec <ve...@xxxxxxx> wrote:



This question is not (entirely) rhetoric, as I'm thinking of some
application reading 1,000,000s words out of text files and turning them
into symbols/keywords for processing. Cutting down the memory
footprint by half or more would be extremely significant, while still
preserving "most" of the properties of symbols, while sacrifing a few,
ie, while

The thing you are looking for is a string. You want to have only one
instance of each string: that's what a hashtable does.

If you want your lexer to avoid consing even temporary instances of
the strings it reads, then you probably want to use a trie (unlike the
above two you will have to write your own of these).  Generally it is
probably not worth the effort though, unless you have other reasons to
want to use a trie - the ephemeral string consing will be pretty
cheap.

It is true that Neanderthal Lisp programs did use symbols for strings
a lot, but I don't think people would generally do that now (outside
of AI depts, where most of the Lisp programmers are still pretty
neanderthal).

Apart from all the previous comments which I agree with, there is an
issue that has been nagging me for some time. I see several libraries
(I won't name names!) that "abuse" keywords. The typical example is
the home brew HTML replacement that does the following

(:html (:head ...) (:body (:h1 ... (:ul ...))))

you get the idea.

I would advocate against this (and similar) use of keywords. Packaged
symbols are perfect for this kind of job.

Cheers
--
Marco



.



Relevant Pages

  • Re: search 1000 keywords in doc.
    ... Dim strText As String ... 'Open your keywords document ... 'Close your keywords document ... For lngCounter = 0 to UBound ...
    (microsoft.public.word.vba.general)
  • Re: Algoritim - Create Unique Integer from String
    ... back to the original string), only that a unique string produce a unique ... spam categorizer uses some sort of one-way hash for its Naive Bayes ... It breaks the messages up into keywords, ... before it stores them in the database (or compares them to existing ...
    (comp.programming)
  • RE: Extracting keywords from a string
    ... Keywords table. ... Function GetLongWords(ByVal strText As String, ... Dim intSpacePos As Integer ... Dim strWord As String, strWordList As String ...
    (microsoft.public.access.queries)
  • Re: Negate a character sequence in a regular expression?
    ... The engine starts scanning through the string until matches 'cat'. ... where cat and dog were separated by only a few ... but the frequency of appearance of the keywords ... you need to add the /m modifier if your strings are paragraphs. ...
    (comp.lang.ruby)
  • Re: Contains clause with only NOT keywords
    ... For your date query it would look like this ... You cannot search on a date string and hope for it to be interpreted as ... I am designing a search screen that searches for keywords in Text ... I also tried separating out the NOT keywords into a series of " and not ...
    (microsoft.public.sqlserver.fulltext)