help with a database in newlisp

Started by tomtoo, November 24, 2018, 05:28:45 AM

Previous topic - Next topic

tomtoo

Hi guys,



I need a little help with creating a database with newlisp. I'd like to use "lookup" to search for various things, but I'm not sure how to create the database with all the needed elements. here's the result of what I have now:

(set 'all-computers '(
  ((atag "444") (person "yyy") (room "") (role nil))))


This does not look right! how can I do something like
(lookup person all-computers)

and determine atag  or "not entered" for room or role?



I'll probably use this for myself, and use it to populate a real database or spreadsheet.



thanks :-)

HPW

#1
Hello,



You may have a look at nldb from here:



https://github.com/cormullion/newlisp-projects/tree/master/nldb">https://github.com/cormullion/newlisp-p ... aster/nldb">https://github.com/cormullion/newlisp-projects/tree/master/nldb



You may also find discussions here with a Forum search for 'nldb'



At least you can use 'assoc' on your list.



Or use modules for real databases.



Regards
Hans-Peter

tomtoo

#2
thank you I'll have a look.

rickyboy

#3
Here are some archived blog posts on nldb by the author.



Simple database in newLISP

https://newlisper.wordpress.com/2009/01/30/simple-database-in-newlisp-2/">https://newlisper.wordpress.com/2009/01 ... newlisp-2/">https://newlisper.wordpress.com/2009/01/30/simple-database-in-newlisp-2/



Simple database, second attempt

https://newlisper.wordpress.com/2009/01/30/simple-database-second-attempt/">https://newlisper.wordpress.com/2009/01 ... d-attempt/">https://newlisper.wordpress.com/2009/01/30/simple-database-second-attempt/



Updates to nldb

https://newlisper.wordpress.com/2009/09/12/updates-to-nldb-2/">https://newlisper.wordpress.com/2009/09 ... to-nldb-2/">https://newlisper.wordpress.com/2009/09/12/updates-to-nldb-2/
(λx. x x) (λx. x x)

cameyo

#4
The book "A Practical Introduction to Fuzzy Logic using LISP" contains a section that explains the management of csv files (builds a simple CSV library).

The code is written in newLisp.



cameyo