Author Topic: Group project  (Read 11553 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Group project
« on: June 23, 2004, 07:13:01 AM »
I have an idea for a group project. Create a standard function that reads some type of config file and return the values in a association list of variable and value. The function should accept at least one argument, the name/location of the config file to read, with the possibility of a comment character.

Example:
# config file to read
# <-- denotes a comment
Variable=value
# or
Variable value
# end of config file

in return from our function we would get an association list in the form of;
(("variable" . value))

thoughts?
TheSwamp.org  (serving the CAD community since 2003)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Group project
« Reply #1 on: June 23, 2004, 08:37:17 AM »
Sounds like an INI FILE to LIST type of thing (defun INI->LIST ( FileName ) ...), and I believe (or logic suggests) it has already been done (several times over).

However, if it's for the sake of an exercise it would be fun, with the strict provision that the participants draw solely from their own grey matter; no other forums, newsgroups etc. used as resources.

If I had the time I would have kicked this off with an outline of all the perceived required functions, but alas.

I would say that you'd want the ability to read from, publish to, replace, find ...

... gotto head off to work now, doh! :(
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Group project
« Reply #2 on: June 23, 2004, 08:50:49 AM »
Quote from: MPuckett
Sounds like an INI FILE to LIST type of thing (defun INI->LIST ( FileName ) ...), and I believe (or logic suggests) it has already been done (several times over).

True, it has been done for an .ini file, however I was thinking something other than the INI format.
 
Quote from: MPuckett

I would say that you'd want the ability to read from, publish to, replace, find ...

I had not thought of the last two, good idea.
Quote from: MPuckett
... gotto head off to work now, doh! :(

Don't you just hate that!!
TheSwamp.org  (serving the CAD community since 2003)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Group project
« Reply #3 on: June 23, 2004, 10:17:32 AM »
Quote from: Mark Thomas
True, it has been done for an .ini file, however I was thinking something other than the INI format.

Help me out Mark, how does "variable=value" differ from the ini format, and ... what would be the benefit(s) of establishing a different format? I think to fully answer that you'd have to identify where the ini format comes up short and could be improved upon (challenge extended).
 
Quote from: Mark Thomas
Quote from: MPuckett
... gotto head off to work now, doh! :(

Don't you just hate that!!

Yes and no. :roll:

Cheers for now. :)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

JohnK

  • Administrator
  • Seagull
  • Posts: 10646
Group project
« Reply #4 on: June 23, 2004, 10:30:17 AM »
*cough!* XML
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Group project
« Reply #5 on: June 23, 2004, 10:48:24 AM »
Quote from: Se7en
*cough!* XML

Good point. A capable, albeit bloated format. :)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

JohnK

  • Administrator
  • Seagull
  • Posts: 10646
Group project
« Reply #6 on: June 23, 2004, 10:55:15 AM »
lol. But zero to no updating required. Once your able to "talk to the parser" all your work is done. You never have to worry about format changes or anything like that.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Group project
« Reply #7 on: June 23, 2004, 11:06:23 AM »
Quote

 Help me out Mark, how does "variable=value" differ from the ini format, and ... what would be the benefit(s) of establishing a different format?

It doesn't, but we could make the separator anything, the '=' seemed like the easiest to program and understand from the users perspective. The .ini files typically use headers(?) as in '[foobar]' which is more than I was thinking in terms of programming. The benefits of establishing our own format would be just that, it's ours, something different. I'm not knocking the INI format here, it's very easy to understand, it's just that it's already been done. Of course creating a format that hasn't might be more of a challenge than writing the function that reads it!

One of the things we should consider (maybe the most) is from a users perspective. How easy will it be for the average user to understand the format of the config file.
TheSwamp.org  (serving the CAD community since 2003)

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Group project
« Reply #8 on: June 23, 2004, 11:07:37 AM »
Quote from: Se7en
*cough!* XML

think of it from the users perspective. can joe user figure it out?
TheSwamp.org  (serving the CAD community since 2003)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Group project
« Reply #9 on: June 23, 2004, 11:17:03 AM »
Quote from: Mark Thomas
... we could make the separator anything, the '=' seemed like the easiest to program and understand from the users perspective. The .ini files typically use headers(?) as in '[foobar]' which is more than I was thinking in terms of programming. The benefits of establishing our own format would be just that, it's ours, something different. I'm not knocking the INI format here, it's very easy to understand, it's just that it's already been done. Of course creating a format that hasn't might be more of a challenge than writing the function that reads it!

One of the things we should consider (maybe the most) is from a users perspective. How easy will it be for the average user to understand the format of the config file.

It sounds to me like a specifification needs to be developed, and as such, you need to open this discussion to those "users" you refer to that need to have this "easy" format, lest "we" construct a great new format that meets "our" needs as bit pushers but leaves users scritchin' their nuggins.

( I hope you don't interpret my participation thus far as antagonistic; sometimes I don't read to well of boards like this. :roll: )
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

JohnK

  • Administrator
  • Seagull
  • Posts: 10646
Group project
« Reply #10 on: June 23, 2004, 11:23:04 AM »
Quote from: MPuckett
...( I hope you don't interpret my participation thus far as antagonistic; sometimes I don't read to well of boards like this. :roll: )...


...I got a smile on my face. (I read things said on this board "positivley" first.) No one is gonna take what you say neg. Here watch:

Mark is an orange picker!!!
Dent is an old man!!
T-Bear couldnt canoe out of a paper bag!
Craig dosent know what HTML is!
...

Hey, that was kinda fun!
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Group project
« Reply #11 on: June 23, 2004, 11:59:06 AM »
Quote from: MPuckett
( I hope you don't interpret my participation thus far as antagonistic; sometimes I don't read to well of boards like this. :roll: )

No, not at all.
TheSwamp.org  (serving the CAD community since 2003)

JohnK

  • Administrator
  • Seagull
  • Posts: 10646
Group project
« Reply #12 on: June 23, 2004, 12:18:42 PM »
Ok Mark i think i am starting to understand you now, but i guess I wanted an example usage for this app.
Drawing properties, or for future applications that we write?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Group project
« Reply #13 on: June 23, 2004, 12:26:17 PM »
OK, let me backup a minute. MPuckett mentioned earlier "I would say that you'd want the ability to read from, publish to, replace, find" If the function can do all of those things why am I hung-up on the format of the config file *shrug* who knows! Anyway moving right along.......
TheSwamp.org  (serving the CAD community since 2003)

t-bear

  • Guest
Group project
« Reply #14 on: June 23, 2004, 12:40:54 PM »
T-Bear can't get his canoe INTO a paper bag!








See, I *was* paying attention!
I haven't got a clue, but I'm paying attention.



PS  You forgot Keith.....where IS he, anyhow? This sounds like sumpin he'd like to play with.