Re: Possible new issue introduced with 20140316 release

Mackram Raydan <[email protected]> Tue, 08 Apr 2014 17:20:02 +0300
Newsgroups gmane.lisp.clsql.general
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============0670391320==
Content-Type: multipart/alternative;
	boundary="------------070309020405090309050900"

This is a multi-part message in MIME format.
--------------070309020405090309050900
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hey Ralf,

Thanks for taking the time to respond. I am aware of the changes (I had 
hoped to show my awareness of that in my email though it probably did 
not come across) although I was not aware that Russ was responsible for 
them.

With that said, I am all for the refactoring (as a matter of fact I used 
the example of clsql's refactor as an example of good software practice 
for my team here), however this does not answer why the change from 
*read-from-string* to *intern* .
The problem as I see it is by choosing intern we inherently imply that 
the symbol should come from the default package that the function intern 
takes as a keyword. By choosing read-from-string you allow the user to 
set any package he/she wishes by virtue that he can choose to pass the 
package:symbol-name to the db. That is what I was trying to refer to in 
my example, I hope I made it clear this time around (if not I will retry 
with a clearer code example)

Thank you

On 04/08/2014 04:55 PM, Ralf Mattes wrote:
> On Tue, Apr 08, 2014 at 04:08:03PM +0300, Mackram Raydan wrote:
>> ....
>> Can someone please help by shedding some light on why the change was done?
> Use your tools  :-)
>
> $ git blame oodml.lisp
>
>   ...
>   4f756ab5 sql/oodml.lisp    (Russ Tyndall       2013-06-20 15:12:31 -0400  623)        (when (< 0 (length val))
>   4f756ab5 sql/oodml.lisp    (Russ Tyndall       2013-06-20 15:12:31 -0400  624)          (intern (symbol-name-default-case val))))
>   4f756ab5 sql/oodml.lisp    (Russ Tyndall       2013-06-20 15:12:31 -0400  625)       ((smallint mediumint bigint integer universal-time)
>   ...
>
> So Russ did it in commit 4f756ab5.
> $ git log 4f756ab5
>
>   commit 4f756ab532ff033a34597a1c8030379e252952ca
>   Author: Russ Tyndall <[email protected]>
>   Date:   Thu Jun 20 15:12:31 2013 -0400
>
>      refactored read-sql-value to centralize this logic and reduce
>      overloading cases
>
>       * read-eval is off for all read-sql-value cases now
>       * the type=symbol case uses intern instead read-from-string
>
> Does this help?
>
>
> alf Mattes


--------------070309020405090309050900
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hey Ralf,<br>
      <br>
      Thanks for taking the time to respond. I am aware of the changes
      (I had hoped to show my awareness of that in my email though it
      probably did not come across) although I was not aware that Russ
      was responsible for them. <br>
      <br>
      With that said, I am all for the refactoring (as a matter of fact
      I used the example of clsql's refactor as an example of good
      software practice for my team here), however this does not answer
      why the change from <b>read-from-string</b> to <b>intern</b> . <br>
      The problem as I see it is by choosing intern we inherently imply
      that the symbol should come from the default package that the
      function intern takes as a keyword. By choosing read-from-string
      you allow the user to set any package he/she wishes by virtue that
      he can choose to pass the package:symbol-name to the db. That is
      what I was trying to refer to in my example, I hope I made it
      clear this time around (if not I will retry with a clearer code
      example)<br>
      <br>
      Thank you<br>
      <br>
      On 04/08/2014 04:55 PM, Ralf Mattes wrote:<br>
    </div>
    <blockquote cite="mid:20140408135538.GA1765-OuoMP45H64u6ogTlOYt/[email protected]"
      type="cite">
      <pre wrap="">On Tue, Apr 08, 2014 at 04:08:03PM +0300, Mackram Raydan wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">....
Can someone please help by shedding some light on why the change was done?
</pre>
      </blockquote>
      <pre wrap="">
Use your tools  :-)

$ git blame oodml.lisp

 ...
 4f756ab5 sql/oodml.lisp    (Russ Tyndall       2013-06-20 15:12:31 -0400  623)        (when (&lt; 0 (length val))
 4f756ab5 sql/oodml.lisp    (Russ Tyndall       2013-06-20 15:12:31 -0400  624)          (intern (symbol-name-default-case val))))
 4f756ab5 sql/oodml.lisp    (Russ Tyndall       2013-06-20 15:12:31 -0400  625)       ((smallint mediumint bigint integer universal-time)
 ...

So Russ did it in commit 4f756ab5.
$ git log 4f756ab5

 commit 4f756ab532ff033a34597a1c8030379e252952ca
 Author: Russ Tyndall <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]">&lt;[email protected]&gt;</a>
 Date:   Thu Jun 20 15:12:31 2013 -0400

    refactored read-sql-value to centralize this logic and reduce
    overloading cases

     * read-eval is off for all read-sql-value cases now
     * the type=symbol case uses intern instead read-from-string

Does this help? 


alf Mattes
</pre>
    </blockquote>
    <br>
  </body>
</html>

--------------070309020405090309050900--

--===============0670391320==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
CLSQL mailing list
[email protected]
http://lists.b9.com/cgi-bin/mailman/listinfo/clsql

--===============0670391320==--