Hi,
It's  Ballona from Brazil.
It's my first post. I'm new to PicoLisp.  I'm new to Lisp.
I've worked with Mumps all my life.  I've read a bit about C and Ruby.
I don't know if I'm missing something here, but see the example below:

test.l:
(pool "test.db")

(class +Country +Entity)
(rel code (+Need +Key +String))
(rel desc (+Need +String))

(obj ((+Country) code "br") desc "Brazil")
(commit)

(obj ((+Country) code "us") desc "")
(commit)

(obj ((+Country) code "ar") )
(commit)

# I know I shouldn't do this, but it's only to keep it simple
(show '{1})
(show '{2})
(show '{3})
(show '{4})
(show '{5})
(show '{6})

$ ../picolisp/p @dbg.l
: (load "test.l")
{1} NIL
   +Country {3}
{2} (+Country)
   desc "Brazil"
   code "br"
{3} NIL
   code (3 . {4})
{4} (NIL ("ar" NIL . {6}) ("br" NIL . {2}) ("us" NIL . {5}))
{5} (+Country)
   code "us"
{6} (+Country)
   code "ar"
-> {6}
:

Now, I would expect that if I ask a +Country object without a description
(us and/or ar) to be created it shouldn't because of the +Need constraintin
desc.  I'd expected an error or something.

Why have they been created?
How to prevent this in PicoLisp?

I'm not interested at present on the GUI aspects of it, but only classes and
database.

I'm using PicoLips 2.3.4. I've just downloaded and compiled it on Cygwin.

PicoLisp seems to be a GREAT work.  Thank you very much for sharing with us.

Best regards,
ballona

------=_Part_22805_24837264.1223142534905
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div dir="ltr">Hi,<br>It&#39;s&nbsp; Ballona from Brazil.<br>It&#39;s my first 
post. I&#39;m new to PicoLisp.&nbsp; I&#39;m new to Lisp.<br>I&#39;ve worked 
with Mumps all my life.&nbsp; I&#39;ve read a bit about C and Ruby.<br>I 
don&#39;t know if I&#39;m missing something here, but see the example below:<br>

<br>test.l:<br>(pool &quot;test.db&quot;)<br><br>(class +Country 
+Entity)<br>(rel code (+Need +Key +String))<br>(rel desc (+Need 
+String))<br><br>(obj ((+Country) code &quot;br&quot;) desc 
&quot;Brazil&quot;)<br>(commit)<br>

<br>(obj ((+Country) code &quot;us&quot;) desc 
&quot;&quot;)<br>(commit)<br><br>(obj ((+Country) code &quot;ar&quot;) 
)<br>(commit)<br><br># I know I shouldn&#39;t do this, but it&#39;s only to 
keep it simple<br>(show &#39;{1})<br>

(show &#39;{2})<br>(show &#39;{3})<br>(show &#39;{4})<br>(show 
&#39;{5})<br>(show &#39;{6})<br><br>$ ../picolisp/p @dbg.l<br>: (load 
&quot;test.l&quot;)<br>{1} NIL<br>&nbsp;&nbsp; +Country {3}<br>{2} 
(+Country)<br>&nbsp;&nbsp; desc &quot;Brazil&quot;<br>

&nbsp;&nbsp; code &quot;br&quot;<br>{3} NIL<br>&nbsp;&nbsp; code (3 . 
{4})<br>{4} (NIL (&quot;ar&quot; NIL . {6}) (&quot;br&quot; NIL . {2}) 
(&quot;us&quot; NIL . {5}))<br>{5} (+Country)<br>&nbsp;&nbsp; code 
&quot;us&quot;<br>{6} (+Country)<br>&nbsp;&nbsp; code &quot;ar&quot;<br>

-&gt; {6}<br>:<br><br>Now, I would expect that if I ask a +Country object 
without a description (us and/or ar) to be created it shouldn&#39;t because of 
the +Need constraintin desc.&nbsp; I&#39;d expected an error or something.<br>
<br>Why have they been created?<br>How to prevent this in PicoLisp?<br>
<br>I&#39;m not interested at present on the GUI aspects of it, but only 
classes and database.<br><br>I&#39;m using PicoLips <a href="http://2.3.4."; 
target="_blank">2.3.4.</a> I&#39;ve just downloaded and compiled it on 
Cygwin.<br>
<br>PicoLisp seems to be a GREAT work.&nbsp; Thank you very much for sharing 
with us.<br>
<br>Best regards,<br>ballona<br><br><br></div>

------=_Part_22805_24837264.1223142534905--
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]

Reply via email to