Search found 429 matches

by itistoday
Sat Feb 20, 2010 5:49 am
Forum: newLISP newS
Topic: Introducing Objective newLISP
Replies: 18
Views: 10175

Re: Introducing Objective newLISP

hilti wrote:

Code: Select all

ERR: invalid function in function format : (MAIN:self 1)
called from user defined function Book:text
It works fine on my end, I'm guessing you're running an older version of newLISP that doesn't support the new FOOP stuff.
by itistoday
Sat Feb 20, 2010 2:20 am
Forum: So, what can you actually DO with newLISP?
Topic: sqlite3 problem "no such table"
Replies: 3
Views: 3295

Re: sqlite3 problem "no such table"

BTW, if you're interested in another sqlite3 module, you can take a look at Dragonfly's . It uses a generic interface and ObjNL so that in the future you can easily change databases if needed. If you check out the mercurial repository for Dragonfly, there's some neat stuff in there that I've added r...
by itistoday
Sat Feb 20, 2010 1:56 am
Forum: newLISP newS
Topic: Introducing Objective newLISP
Replies: 18
Views: 10175

Re: Introducing Objective newLISP

BTW, to get exactly michael's version for Chapter, this would be the required ObjNL constructor: (define (Chapter:Chapter _num) (if (= @self @class) (autorelease (eval (extend (list 'instantiate @class _num) $args))) (set 'num _num 'paragraphs (map retain $args)) ) ) Edit: If you didn't care about c...
by itistoday
Sat Feb 20, 2010 1:35 am
Forum: newLISP newS
Topic: Introducing Objective newLISP
Replies: 18
Views: 10175

Re: Introducing Objective newLISP

cormullion, I would check to see if FOOP satisfies your needs for your book project. ObjNL is for situations where you have complicated object relationships, and objects are being passed around and modified. To use ObjNL properly, you also need to correctly make use of the functions retain and relea...
by itistoday
Fri Feb 19, 2010 8:06 pm
Forum: newLISP newS
Topic: Introducing Objective newLISP
Replies: 18
Views: 10175

Re: Introducing Objective newLISP

I'm thinking about trying out ObjNL for a project. But I can't get started... Fancy helping me? The general idea is to create a book, containing chapters, each of which contain sections, each of which contain paragraphs. Would ObjNL be a good way to explore/develop this kind of structure? It certai...
by itistoday
Thu Feb 18, 2010 9:07 pm
Forum: newLISP in the real world
Topic: Request: Function to give context given symbol
Replies: 41
Views: 13495

Re: Request: Function to give context given symbol

Just an update to this thread, newlisp 10.1.11 makes for-query-with-db possible! :-)
by itistoday
Thu Feb 18, 2010 9:07 pm
Forum: newLISP newS
Topic: newLISP development release v.10.1.11
Replies: 11
Views: 7213

Re: newLISP development release v.10.1.11

Wow, I just realized something that makes me feel a little silly, I actually didn't need caller at all to do this. :-p As long as I'm given at least one parameter to the macro which *is* a symbol (literals like strings won't work) then I can get the calling context. In this case the parameter db ser...
by itistoday
Mon Feb 15, 2010 10:27 pm
Forum: newLISP newS
Topic: newLISP development release v.10.1.11
Replies: 11
Views: 7213

Re: newLISP development release v.10.1.11

Given that it seems the situation is unlikely to change, I've changed the way the function works to be like so: (define (fn-query-with-db db query func) (let (sql (db:prepare-sql query) keys '()) (setf keys (map sql:col-name (sequence 0 (-- (sql:col-count))))) (push-autorelease-pool) ; in case we ha...
by itistoday
Mon Feb 15, 2010 10:17 pm
Forum: Anything else we might add?
Topic: does get-url support https?
Replies: 5
Views: 4839

Re: does get-url support https?

Yeah I'm currently using 'curl' right now, was just wondering if there were any plans for building this into newlisp.
by itistoday
Mon Feb 15, 2010 9:43 pm
Forum: newLISP newS
Topic: newLISP development release v.10.1.11
Replies: 11
Views: 7213

Re: newLISP development release v.10.1.11

isn't 'Dragonfly' (as a context) what you want to have returned from the caller of '(for-query-with-db db query)' ? Isn't the function which calls '(for-query-with-db db query)' in the 'Dragonfly' context? Yes, it is. Do you not see something weird about caller returning Route.Static, and then Drag...
by itistoday
Mon Feb 15, 2010 9:15 pm
Forum: newLISP newS
Topic: newLISP development release v.10.1.11
Replies: 11
Views: 7213

Re: newLISP development release v.10.1.11

Here's more bizarro weirdness: (define-smacro (for-query-with-db db query) (letn (db (eval db) sql (db:prepare-sql (eval query)) keys '() ctx (prefix (caller))) (println ctx " vs " (prefix (caller))) ; <-------- WTF? (dotimes (i (sql:col-count)) ;(push (sym (upper-case (sql:col-name i)) (prefix (cal...
by itistoday
Mon Feb 15, 2010 8:59 pm
Forum: newLISP newS
Topic: newLISP development release v.10.1.11
Replies: 11
Views: 7213

Re: newLISP development release v.10.1.11

The universal darwin makefile will be added back. Thanks! Regarding 'caller': It returns the calling function, not the context of the function called. See here for valid examples: Sorry, I edited my post because I saw that as well, please see the post again. Your example seems to imply, that you wa...
by itistoday
Mon Feb 15, 2010 8:41 pm
Forum: newLISP newS
Topic: newLISP development release v.10.1.11
Replies: 11
Views: 7213

Re: newLISP development release v.10.1.11

Also, looks like caller isn't working as I'd hoped: > (context 'foo) foo foo> (define (foo:foo) (caller)) (lambda () (caller)) foo> (context MAIN) MAIN > (foo) nil Apparently I have to call (foo) from within a function for caller to be useful, and not even any function but specifically a *user-defin...
by itistoday
Mon Feb 15, 2010 8:27 pm
Forum: newLISP newS
Topic: newLISP development release v.10.1.11
Replies: 11
Views: 7213

Re: newLISP development release v.10.1.11

Where did my makefile_darwin_universal_utf8_compat go? It's no longer with the source distribution. This is a rather important makefile, as with it I am able to safely bundle newlisp scripts with the newlisp binary.
by itistoday
Mon Feb 15, 2010 6:45 pm
Forum: Anything else we might add?
Topic: does get-url support https?
Replies: 5
Views: 4839

Re:

Lutz wrote:No SSL protocol support yet
Any plans for this? Would be rather useful if get/put/post-url functions supported this.
by itistoday
Tue Feb 09, 2010 3:56 pm
Forum: newLISP in the real world
Topic: Request: Function to give context given symbol
Replies: 41
Views: 13495

Re: Request: Function to give context given symbol

P.S. Can depreciated names be implemented in such a way that they continue to refer to the original but will not complain when overwritten? Like changing them from constants to variables. That would be one small step toward minimizing code disruption. That's pretty much the effect achieved by the d...
by itistoday
Mon Feb 08, 2010 4:52 pm
Forum: newLISP in the real world
Topic: Request: Function to give context given symbol
Replies: 41
Views: 13495

Re: Request: Function to give context given symbol

All of them are too costly for what they add in size and complexity and take away in loading performance. The deprecation map would add hardly anything in size. Maybe 1KB, max. As time went on it would get smaller in size because items would be removed from it. Eventually it could be removed if the...
by itistoday
Mon Feb 08, 2010 4:13 am
Forum: newLISP in the real world
Topic: Request: Function to give context given symbol
Replies: 41
Views: 13495

Re: Request: Function to give context given symbol

Perhaps the real solution is to find a method that gracefully handles all newLISP versions without needing to change any code You know I thought I gave a pretty good generic solution to this problem (see above) that would allow backwards compatibility with existing code while at the same time givin...
by itistoday
Sun Feb 07, 2010 1:09 am
Forum: newLISP in the real world
Topic: Request: Function to give context given symbol
Replies: 41
Views: 13495

Re: Request: Function to give context given symbol

Yes, 'term' absolutely works and it is short too and a beautiful word! 'term' will be introduced in the coming release version 10.2.0 (or any development version before it). Yay, I'm glad we've come to a conclusion on this, this way I can update Dragonfly to support existing versions of newLISP and...
by itistoday
Fri Feb 05, 2010 10:18 pm
Forum: So, what can you actually DO with newLISP?
Topic: Set or add a pair to a list by reference
Replies: 11
Views: 6637

Re: Set or add a pair to a list by reference

You have to stay in FOOP. Your definition of A:mod is not staying in the FOOP paradigm. Fine, but all that means is that FOOP is a very narrow subset of OOP. Tim wanted to know how to do reference passing in newLISP and I'm just pointing out that most of the time, FOOP is not a good way of doing it.
by itistoday
Fri Feb 05, 2010 9:24 pm
Forum: newLISP in the real world
Topic: Request: Function to give context given symbol
Replies: 41
Views: 13495

Re: Request: Function to give context given symbol

There are several neat aspects to sym-context and sym-name:
  1. They tell you almost exactly what the function takes and what it returns
  2. They avoid conflicts in code with commonly used symbol names
  3. They "complete the picture" with sym, creating the "sym family of functions"
by itistoday
Fri Feb 05, 2010 9:15 pm
Forum: newLISP in the real world
Topic: Request: Function to give context given symbol
Replies: 41
Views: 13495

Re: Request: Function to give context given symbol

I still like 'path' best, but how about 'space' ? What does Cormullion think about all this? I want something short! What's wrong with context-of ? It's not going to be a very often used function, and there are plenty of newLISP functions that are longer (write-buffer, bayes-query, remove-file, etc...
by itistoday
Fri Feb 05, 2010 8:54 pm
Forum: So, what can you actually DO with newLISP?
Topic: Set or add a pair to a list by reference
Replies: 11
Views: 6637

Re: Set or add a pair to a list by reference

If you stay in FOOP when passing on objets that is not true. See this example from qa-foop: Ah, I didn't know that, but what I said is still mostly true, in 90% of the cases where objects are passed around in a normal OO language, in FOOP they would be passed by value, not by reference. Here's a tr...
by itistoday
Fri Feb 05, 2010 6:38 pm
Forum: newLISP in the real world
Topic: Request: Function to give context given symbol
Replies: 41
Views: 13495

Re: Request: Function to give context given symbol

m i c h a e l wrote:Since contexts are namespaces in newLISP, wouldn't namespace and context be in conflict?
That's a good point, in light of that I vote for Kazimir's context-of.
by itistoday
Fri Feb 05, 2010 5:33 pm
Forum: So, what can you actually DO with newLISP?
Topic: Set or add a pair to a list by reference
Replies: 11
Views: 6637

Re: Set or add a pair to a list by reference

If you want to pass by reference, you also can use the new FOOP (since development version 10.1.8) as defined here: http://www.newlisp.org/downloads/development/newLISP-10.2-Release.html and stable in current development version 10.1.10. Thank you Lutz. I will lay low for a while and try to to dige...