Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - cormullion

#31
I've been trying out the new Node.js-based editor, Atom.io. There's a lot to like about it, but the central problem is that it's slowish - it struggles with loading new documents, for example. Perhaps we all spend so much time waiting in web browsers anyway, it's not a problem... :)
#32
newLISP in the real world / Re: Intersect bug
March 04, 2014, 09:37:16 AM
No worries - it made me read that part of the manual again, so I gained something too... :)
#33
newLISP in the real world / Re: Intersect bug
March 04, 2014, 03:02:28 AM
Perhaps there are some variations in the definition of intersection...



With this definition: "All the elements of set A that are in set B":


(intersect '(1 2 2 2 3) '(2 2) true)
;-> (2 2 2)


it looks correct. But "All the elements of set B that are in set A" should be returning '(2 2). Trouble is, A and B aren't sets... :)
#34
newLISP in the real world / Re: Intersect bug
March 04, 2014, 02:07:51 AM
Hi tadeas. Is that a bug?
#35
By the way, the error appeared when using OAuth authentication for the Twitter API - I think the authentication keys supplied by Twitter are longer and so triggered the if clause...
#36
newLISP in the real world / Problem in crypto.lsp?
March 01, 2014, 10:05:03 AM
Hi Lutz! I ran into a few problems using crypto.lsp. I eventually solved it by editing the hmac function to look like this:


(define (hmac hash_fn msg_str key_str , blocksize opad ipad)
  (set 'blocksize 64)
  (set 'opad (dup "x5c" blocksize))
  (set 'ipad (dup "x36" blocksize))
  (if (> (length key_str) blocksize)
        (set 'key_str (hash_fn key_str true))) ; <----------------
  (set 'key_str (append key_str (dup "00" (- blocksize (length key_str))))) ;; padding key with binary zeros
  (set 'opad (encrypt opad key_str))
  (set 'ipad (encrypt ipad key_str))
  (hash_fn (append opad (hash_fn (append ipad msg_str) true)) true))


I don't know what the problem was, but it currently appears to work on my Mac... :)
#37
newLISP in the real world / Re: What happened to "if-not"?
September 12, 2013, 05:08:36 AM
Quote from: "xytroxon"It shall be so:

    Madness in great ones must if-not unwatch'd go.



The Tragedy of Hamlet Cormullion, Prince of newLISP Act 3 Scene 1


and from the same pen:


QuoteIf we do meet again, we'll smile indeed.

If not, 'tis true this parting was well made.
#38
newLISP in the real world / Re: What happened to "if-not"?
September 10, 2013, 11:15:51 PM
Quote from: "Lutz"Cannot remember having seen anybody actually using if-not, except myself.


Well, these days you don't have to rely on memory - just search the internet. For example, on Github, two repositories not unknown to the newLISP community - Artful-Code, and Dragonfly - both make use of this function. I use it too. So when the "indefinite" time comes, everyone who has used those repositories will be inconvenienced, for no very good reason (that you've given).


Quote from: "Lutz"The VIM editor highlights it as deprecated.


Ah, so we all have to use VIM now?
#39
newLISP in the real world / Re: What happened to "if-not"?
September 10, 2013, 12:05:01 PM
Good points, Ricky. And of course the confused user can't unconfuse themselves by looking in the manual, so, if they find some code of mine which uses if-not, they might not be able to work out how to get my code running. (Not that many people bother.. :).) I do think I use if-not rather like a Perl die: if something's not right, abandon ship. Besides, I never use if in that ladder-like way anyway...



I just get a feeling that this sort of discussion is energy going in the wrong direction. Forget this type of infelicity, leave unbroken things unfixed, and write some code, or a blog post, or something beneficial. That's what I'd say if I were in charge.:)



(Typed in haste on an iPad while eating dinner...!)
#40
Some of the files are still available, at http://web.archive.org/web/20070907010731/http://www.intricatevisions.com/index.cgi?page=nlfuzzy">//http://web.archive.org/web/20070907010731/http://www.intricatevisions.com/index.cgi?page=nlfuzzy. The test function isn't there, but could probably be re-built. It's something like:


(define (print-test-fn )
  (println (args 0))
  (dolist (a (rest (args)))
     (dolist (a1 a)
         (print " " (pop a1))
           (while a1
            (print "  "(first a1) " : result " (eval (pop a1)) ", expected " (pop a1) "n")))))


although that goes wrong towards the end.



But hurry, before the wayback machine loses its way back, or before Lutz obsoletes any more keywords... :)
#41
newLISP in the real world / Re: What happened to "if-not"?
September 05, 2013, 09:57:58 AM
Thoughts...



You may indeed be technically correct - and there may indeed be some logical semantic justification for removing it. However:


QuoteThe main difference to other programming language philosophies is, that some of newLISP's traits are influenced by thinking that is normally not found in the community of programming language geeks.



I think it is less about "consistency" or "it has feature x" as it is about categories like "beauty", "feeling right", "intuitivity", "learnability" etc. whereby the judges of these categories are not the only the geeks but the average user. People who are experts in other areas which are not programming languages...


(then the author goes off the rails a bit... :).



You've not persuaded me that if-not should be removed at some unspecified time in the future, breaking not a few pieces of code in the process, requiring the inserting of a more complicated construction, plus consequent testing, uploading, etc., just to make an important semantic point, or to remove one of the thousands of ways a new user can write bad code. I can't see any other benefit for removing it (from the code base or from the documentation) - how many bytes will it save?



I missed any discussion of this proposal before - but I do remember arguing against changes that broke code for no good reason. Anyway, ricky, if-not was http://www.newlispfanclub.alh.net/forum/viewtopic.php?f=5&t=2388">your idea in the first place!
#42
newLISP in the real world / Re: What happened to "if-not"?
September 04, 2013, 01:43:42 PM
:)



The function will "keep working for an indefinite time". More Doctor Who than Sherlock?
#43
I hope not. No point in changing the basics of the language at this point, surely?
#44
Thanks for the kind words, Lutz. I'm content to not be a programming geek (anyway I failed the entrance exam). In fact, I studied music at college, so I'm not even a proper writer... :) But as you know I particularly like one aspect of newLISP, and that's its informal and casual nature, even though that can be challenging for the more serious programmer...
#45
Good work, FOOperman. And thanks for the "compliment"! :)